This is a migrated thread and some comments may be shown as answers.

Multi column Grid header

1 Answer 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sai
Top achievements
Rank 1
sai asked on 10 May 2016, 11:39 AM

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

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 12 May 2016, 12:12 PM
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.
Tags
Grid
Asked by
sai
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or