Hi:
I am the freshman for the Telerik. I just encounter a strange problem when using the grouping functionality provided by Grid.
I just follow the grouping demo(Outlook-style Grouping) provided by Grid. It works fine. But when i want to remove one of the grouping option, an error is throw. "Sys.WebForms.PageRequestManagerServerErrorException:Specified argument was out of range of valid value.Parameter Name: index"
Please check my source code.
In the server side, a List<Person> object is binded to the Grid.
There are 3 properties in Person.
Anybody can help me?
I am the freshman for the Telerik. I just encounter a strange problem when using the grouping functionality provided by Grid.
I just follow the grouping demo(Outlook-style Grouping) provided by Grid. It works fine. But when i want to remove one of the grouping option, an error is throw. "Sys.WebForms.PageRequestManagerServerErrorException:Specified argument was out of range of valid value.Parameter Name: index"
Please check my source code.
| <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> |
| <%-- <telerik:Header runat="server" ID="Header1" NavigationLanguage="CS"> |
| </telerik:Header>--%> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"> |
| </telerik:RadAjaxLoadingPanel> |
| </div> |
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" |
| GridLines="None" AutoGenerateColumns="False" Width="400px" PageSize="4" AllowCustomPaging="True" |
| ShowGroupPanel="true" PagerStyle-Position="Bottom" OnPageIndexChanged="RadGrid1_PageIndexChanged" |
| OnSortCommand="RadGrid1_SortCommand" PagerStyle-AlwaysVisible="true" |
| OnGroupsChanging="RadGrid1_GroupsChanging" |
| onpagesizechanged="RadGrid1_PageSizeChanged"> |
| <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> |
| <MasterTableView> |
| <GroupByExpressions> |
| <telerik:GridGroupByExpression> |
| <SelectFields> |
| <telerik:GridGroupByField FieldAlias="Sex" FieldName="Sex"></telerik:GridGroupByField> |
| </SelectFields> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="Sex" SortOrder="Descending"></telerik:GridGroupByField> |
| </GroupByFields> |
| </telerik:GridGroupByExpression> |
| <telerik:GridGroupByExpression> |
| <SelectFields> |
| <telerik:GridGroupByField FieldAlias="Age" FieldName="Age"></telerik:GridGroupByField> |
| </SelectFields> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="Age" SortOrder="Descending"></telerik:GridGroupByField> |
| </GroupByFields> |
| </telerik:GridGroupByExpression> |
| <telerik:GridGroupByExpression> |
| <SelectFields> |
| <telerik:GridGroupByField FieldAlias="Name" FieldName="Name"></telerik:GridGroupByField> |
| </SelectFields> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="Name" SortOrder="Descending"></telerik:GridGroupByField> |
| </GroupByFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="column" SortExpression="Name"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Sex" HeaderText="Sex" UniqueName="column1" SortExpression="Sex"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Age" DataType="System.Int32" HeaderText="Age" |
| SortExpression="Age" UniqueName="column2"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True"> |
| <Selecting AllowRowSelect="True"></Selecting> |
| <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True" |
| ResizeGridOnColumnResize="False"></Resizing> |
| </ClientSettings> |
| <GroupingSettings ShowUnGroupButton="true" /> |
| </telerik:RadGrid> |
In the server side, a List<Person> object is binded to the Grid.
There are 3 properties in Person.
| public class Person |
| { |
| public String Name { get; set; } |
| public int Age { get; set; } |
| public SexEnum Sex { get; set; } |
| } |
| public enum SexEnum |
| { |
| Male, |
| Female |
| } |