I've got a RadGrid that's filled dynamically with content... the single grid on the page is used for a variety of queries, so it never knows what columns are going to fill it beforehand.
I've enabled Grouping, and it works... I can drag a column to the header, and the data groups just fine.
However, when I click on the grouped column to try to return it back to the grid (so I can group by a different criteria), I get the following error:
Server Error in '/' Application.
Index was out of range. Must be non-negative and less than the size of the collection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source Error:
Stack Trace:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045
Here is the code for the RadGrid I'm using:
<telerik:RadGrid ID="lst" runat="server" AllowPaging="True" PageSize="5"
OnItemCommand="lst_ItemCommand" CellSpacing="0" GridLines="None" ShowGroupPanel="True" AutoGenerateHierarchy="True" >
<ClientSettings AllowColumnsReorder="True" EnablePostBackOnRowClick ="true" AllowDragToGroup="True" >
<Animation AllowColumnReorderAnimation="True" AllowColumnRevertAnimation="True" />
</ClientSettings>
<MasterTableView CommandItemDisplay="Top" PageSize="100" GroupLoadMode="Client" AutoGenerateColumns="True" AllowSorting="True" EnableLinqGrouping="False" ShowGroupFooter="True" DataKeyNames="ID" >
<CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="False" ShowExportToCsvButton="True" ShowExportToPdfButton="True" ShowRefreshButton="False"></CommandItemSettings>
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
<BatchEditingSettings EditType="Cell"></BatchEditingSettings>
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
</MasterTableView>
<GroupingSettings ShowUnGroupButton="True" />
<SortingSettings SortedBackColor="Yellow" />
<ExportSettings SuppressColumnDataFormatStrings="false">
<Pdf>
<PageHeader>
<LeftCell Text=""></LeftCell>
<MiddleCell Text=""></MiddleCell>
<RightCell Text=""></RightCell>
</PageHeader>
<PageFooter>
<LeftCell Text=""></LeftCell>
<MiddleCell Text=""></MiddleCell>
<RightCell Text=""></RightCell>
</PageFooter>
</Pdf>
<Excel Format="Biff"></Excel>
</ExportSettings>
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>
Is there a setting I'm missing somewhere?
Many thanks in advance.
Jay
I've enabled Grouping, and it works... I can drag a column to the header, and the data groups just fine.
However, when I click on the grouped column to try to return it back to the grid (so I can group by a different criteria), I get the following error:
Server Error in '/' Application.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045
Here is the code for the RadGrid I'm using:
<telerik:RadGrid ID="lst" runat="server" AllowPaging="True" PageSize="5"
OnItemCommand="lst_ItemCommand" CellSpacing="0" GridLines="None" ShowGroupPanel="True" AutoGenerateHierarchy="True" >
<ClientSettings AllowColumnsReorder="True" EnablePostBackOnRowClick ="true" AllowDragToGroup="True" >
<Animation AllowColumnReorderAnimation="True" AllowColumnRevertAnimation="True" />
</ClientSettings>
<MasterTableView CommandItemDisplay="Top" PageSize="100" GroupLoadMode="Client" AutoGenerateColumns="True" AllowSorting="True" EnableLinqGrouping="False" ShowGroupFooter="True" DataKeyNames="ID" >
<CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="False" ShowExportToCsvButton="True" ShowExportToPdfButton="True" ShowRefreshButton="False"></CommandItemSettings>
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
<BatchEditingSettings EditType="Cell"></BatchEditingSettings>
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
</MasterTableView>
<GroupingSettings ShowUnGroupButton="True" />
<SortingSettings SortedBackColor="Yellow" />
<ExportSettings SuppressColumnDataFormatStrings="false">
<Pdf>
<PageHeader>
<LeftCell Text=""></LeftCell>
<MiddleCell Text=""></MiddleCell>
<RightCell Text=""></RightCell>
</PageHeader>
<PageFooter>
<LeftCell Text=""></LeftCell>
<MiddleCell Text=""></MiddleCell>
<RightCell Text=""></RightCell>
</PageFooter>
</Pdf>
<Excel Format="Biff"></Excel>
</ExportSettings>
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>
Is there a setting I'm missing somewhere?
Many thanks in advance.
Jay