I have a radgrid where I want to put two columns under a header. I am attaching a screenshot to this thread to show you what I want. You will see the column "Open Items by Age" is further divided as "Prior" and "Current" columns. Is this possible to do in a radgrid and still maintain the sort for the "Prior" and "Current" columns. I am attaching code to help you see my grid.
Thanks in advance!
Thanks in advance!
<telerik:RadGrid ID="grdCurrentandPrior" runat="server" AllowSorting="True" AutoGenerateColumns="False" GridLines="Horizontal" Skin="Web20" Style="margin-right: 0px" Width="897px" Height="252px" OnNeedDataSource="grdCurrentandPrior_NeedDataSource" OnExcelMLExportRowCreated="grdCurrentandPrior_ExcelMLExportRowCreated" OnSortCommand="grdCurrentandPrior_SortCommand"> <ExportSettings FileName="OpenItemsCurrentInventory" IgnorePaging="True" OpenInNewWindow="True" ExportOnlyData="true" Excel-Format="ExcelML"> </ExportSettings> <MasterTableView CommandItemDisplay="Bottom" AllowNaturalSort="false" UseAllDataFields="true"> <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" /> <Columns> <telerik:GridTemplateColumn DataField="Assignee" HeaderText="Assignee" UniqueName="Assignee" SortExpression="Assignee"> <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" /> <ItemTemplate> <asp:Label ID="lbAssignee" runat="server" Text='<%# Eval("Assignee") %>'></asp:Label> </ItemTemplate> <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="State" HeaderText="State" UniqueName="State" SortExpression="State" Visible="false"> <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" /> <ItemTemplate> <asp:Label ID="lbState" runat="server" Text='<%# Eval("State") %>'></asp:Label> </ItemTemplate> <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="JurisdictionCount" HeaderText="Jurisdictions" UniqueName="JurisdictionCount" SortExpression="JurisdictionCount"> <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" /> <ItemTemplate> <asp:Label ID="lbJurisdiction" runat="server" Text='<%# Eval("JurisdictionCount", "{0:N0}")%>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Right" ForeColor="Black" /> <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="OpenItemsCountPrior" HeaderText="Prior Open Items" UniqueName="OpenItemsCountPrior" SortExpression="OpenItemsCountPrior"> <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" /> <ItemTemplate> <asp:Label ID="lbPrior" runat="server" Text='<%# Eval("OpenItemsCountPrior", "{0:N0}") %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Right" ForeColor="Black" /> <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="OpenItemsCountLastMonth" HeaderText="Last Month Items" UniqueName="OpenItemsCountLastMonth" SortExpression="OpenItemsCountLastMonth"> <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" /> <ItemTemplate> <asp:Label ID="lbLastMonth" runat="server" Text='<%# Eval("OpenItemsCountLastMonth", "{0:N0}") %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Right" ForeColor="Black" /> <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="OpenItemsCountCurrent" HeaderText="Current Open Items" UniqueName="OpenItemsCountCurrent" SortExpression="OpenItemsCountCurrent"> <HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" Font-Names="Arial" /> <ItemTemplate> <asp:Label ID="lbCurrent" runat="server" Text='<%# Eval("OpenItemsCountCurrent", "{0:N0}") %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Right" ForeColor="Black" /> <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="TotalRemainingItems" HeaderText="Items Left to Pay" UniqueName="TotalRemainingItems" SortExpression="TotalRemainingItems"> <HeaderStyle Font-Bold="True" Width="95px" HorizontalAlign="Center" Font-Names="Arial" /> <ItemTemplate> <asp:Label ID="lblTotalRemain" runat="server" Text='<%# Eval("TotalRemainingItems", "{0:N0}") %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Right" ForeColor="Black" /> <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="CompleteCount" HeaderText="Complete" UniqueName="CompleteCount" SortExpression="CompleteCount"> <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" /> <ItemTemplate> <asp:Label ID="lblCompleteCount" runat="server" Text='<%# Eval("CompleteCount", "{0:N0}") %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Right" ForeColor="Black" /> <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="PercentComplete" HeaderText="% Complete" UniqueName="clmPctComplete" SortExpression="PercentComplete"> <HeaderStyle Font-Bold="True" Width="85px" HorizontalAlign="Center" Font-Names="Arial" /> <ItemTemplate> <asp:Label ID="lblPctComplete" runat="server" Text='<%# Eval("PercentComplete", "{0:N2}%")%>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Right" ForeColor="Black" /> <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="AssigneeEmployeeKey" ReadOnly="True" UniqueName="AssigneeEmployeeKey" Visible="False"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <HeaderStyle BorderStyle="Solid" /> <ClientSettings> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings> </telerik:RadGrid>