I'm trying to enable grouping on a grid that is using NeedDataSource to get a LINQ table.
| <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| ongroupschanging="RadGrid1_GroupsChanging" |
| onneeddatasource="RadGrid1_NeedDataSource" AllowPaging="true" ShowGroupPanel="true" > |
| <MasterTableView AllowPaging="true" PageSize="100" DataKeyNames="BuildID" > |
| </MasterTableView> |
| <ClientSettings AllowDragToGroup="true" /> |
| </telerik:RadGrid> |
| protected void RadGrid1_GroupsChanging(object source, Telerik.Web.UI.GridGroupsChangingEventArgs e) |
| { |
| } |
| protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| RadGrid1.DataSource = new DataClasses1DataContext().DataTable; |
| } |
When they drag a header to be grouped, GroupsChanging and NeedDataSource both fire. During GroupsChanging, if I get RadGrid1.MasterTableView.GroupExpressions, as expected the group has not been added.
However, during NeedDataSource, the group has not been added to RadGrid1.MasterTableView.GroupExpressions.
When they drag a header to be ungrouped, both events fire again. During GroupsChanging, the group has not been removed, as expected.
During NeedDataSource it has been removed.
So when you're grouping, NeedDataSource does not have the correct grouping information, and when you're ungrouping, it does.
The "DataTable" has about 30 columns and 12,000 rows.
The version on my Telerik.Web.UI is 2008.2.826.35, and the Runtime Version is v2.0.50727.
The reason I need grouping info during NeedDataSource is because I'm trying to keep Custom Paging after they group headers by doing my own sorting on the LINQ table.
Thanks,
John