Multi column Grid header

2 posts, 0 answers
  1. sai
    sai avatar
    7 posts
    Member since:
    Mar 2016

    Posted 10 May Link to this post

    Hi Team,

    I've two questions.

     1) I'm trying to create a radgrid header with multiple columns grouped under a column,similar like below link.

    http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/multi-column-headers/defaultcs.aspx

     

      <ColumnGroups>
                    <telerik:GridColumnGroup HeaderText="Product Details" Name="ProductDetails" HeaderStyle-HorizontalAlign="Center">
                    </telerik:GridColumnGroup>

      </ColumnGroups>

    I'm getting this below error. I'm using Ajax controls Telerik.Web.UI, v.2011.3.1305.40 (Dev), do this version of telerik controls supports this feature or not?

     

    Please suggest some alternative approach.

    Type 'Telerik.Web.UI.GridTableView' does not have a public property named 'ColumnGroups'.

    2) An alternative for that in Header template I designed a HTML table.

     <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderStyle-Width="250px" AllowFiltering="false" >
                        
                        <HeaderTemplate>
                        <table>
                        <tr>
                        <td colspan="8" style="text-align:center;> 
                            <asp:Label ID="Label10" runat="server" Text=" Unweighted Savings" ></asp:Label>                   
                        </td>                   
                        </tr>
                        <tr>
                        <td>
                        <asp:LinkButton ID="LinkButton2" runat="server" Text=" C&S "   CommandName='Sort' CommandArgument='CS' Font-Underline="true"></asp:LinkButton>                 
                        </td>
                        <td>
                            <asp:LinkButton ID="LinkButton1" runat="server" Text=" M&R "   CommandName='Sort' CommandArgument='MR' Font-Underline="true"></asp:LinkButton>
                        </td>
                        <td>
                            <asp:LinkButton ID="LinkButton3" runat="server" Text=" E&I "  CommandName='Sort' CommandArgument='EI' Font-Underline="true"></asp:LinkButton>
                        </td>
                         <td>
                            <asp:LinkButton ID="LinkButton4" runat="server" Text=" Public Exchange "  CommandName='Sort' CommandArgument='Exchange' Font-Underline="true"></asp:LinkButton>
                        </td>
                         <td>
                            <asp:LinkButton ID="LinkButton5" runat="server" Text=" Private Exchange "   CommandName='Sort' CommandArgument='PrivateExchange' Font-Underline="true"></asp:LinkButton>
                        </td>
                         <td>
                            <asp:LinkButton ID="LinkButton6" runat="server" Text=" Total "   CommandName='Sort' CommandArgument='Total' Font-Underline="true"></asp:LinkButton>
                        </td>
                        </tr>
                        </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                        <table>
                        <tr>
                        <td>
                        <asp:Label ID="Label4" Text='<%# Bind("CS") %>' runat="server" ></asp:Label>
                        </td>
                         <td>
                          <asp:Label ID="Label5" Text='<%# Bind("MR") %>' runat="server" ></asp:Label>
                        </td>
                         <td>
                          <asp:Label ID="Label6" Text='<%# Bind("EI") %>' runat="server" ></asp:Label>
                        </td>
                         <td>
                          <asp:Label ID="Label7" Text='<%# Bind("Exchange") %>' runat="server" ></asp:Label>
                        </td>
                         <td>
                          <asp:Label ID="Label8" Text='<%# Bind("PrivateExchange") %>' runat="server" ></asp:Label>
                        </td>
                         <td>
                          <asp:Label ID="Label9" Text='<%# Bind("Total") %>' runat="server" ></asp:Label>
                        </td>
                        </tr>
                        </table>
                        </ItemTemplate>
                        </telerik:GridTemplateColumn>

     

    I'm getting my desired output, but when i sort any column , entire column is not highlighted and up/down arrow is not coming.

    Unable to filter these columns. inside header template.

    Regards

    Sai Teja

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 12 May Link to this post

    Hello Sai ,

    The error indicates that column groups are not available for that version of the controls. In order to use column groups I would recommend to upgrade the controls to the latest version. The current release is 2016.2.504.

    Moreover, the new version is optimized to work with the current modern browsers. With the version you are running it is likely to see unexpected behavior when opening the page in recent browser version.

    Regards,
    Viktor Tachev
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top