Hello,
I would need some clarification on state preservation of the RadGrid
As indicated here the grid should preserve grouping when view state is enable.
I use the last release a simple grid with a dummy data-source taken from Persist Groups Expanded State on Rebind sample.
Then
- with grouping (server side) the postback button will keep state as Rebind command has been commented out, but if Rebind command is activated the collapsed section information get lost
- with grouping ( still server side ) acting on the sorting reset the collapsed section as well.
- with grouping (client side) selected row and collapsed area are lost as well.
On key Feature page the #19 provide us the following : "an unique feature of Telerik RadGrid is the ability to preserve its appearance, group-by state, sorting, current page, edit or selected state, and resizing after postbacks"
Some links concerning previous built are available like Client-Side Row Selection Persisted With Paging, Persist Groups Expanded State on Rebind .. but don't know if they are still valuable for the last release.
Could someone clarify the situation on what is available / built-in and what should be done manually or not, in order to preserve ALL state, in case of server side and client side usage. ( a kind of matrix would be fine ... plus some links on how to do stuff manually, pointing to avaliable threads like the two above.) A grid demo including all available stuff would be nice as well.
Many thanks in advance for your time.
I would need some clarification on state preservation of the RadGrid
As indicated here the grid should preserve grouping when view state is enable.
I use the last release a simple grid with a dummy data-source taken from Persist Groups Expanded State on Rebind sample.
<telerik:RadGrid ID="RadGrid1" runat="server" |
AllowSorting="true" ShowGroupPanel="True" |
OnNeedDataSource="RadGrid1_NeedDataSource" |
AllowMultiRowSelection="false" |
Skin="Vista" |
> |
<ClientSettings AllowDragToGroup="True" EnablePostBackOnRowClick="true"> |
</ClientSettings> |
<MasterTableView GroupLoadMode="Server" > |
<GroupByExpressions> |
<telerik:GridGroupByExpression> |
<GroupByFields> |
<telerik:GridGroupByField FieldName="Group" /> |
</GroupByFields> |
<SelectFields> |
<telerik:GridGroupByField FieldName="Group" /> |
</SelectFields> |
</telerik:GridGroupByExpression> |
</GroupByExpressions> |
</MasterTableView> |
</telerik:RadGrid> |
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> |
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
{ |
DataTable tbl = new DataTable(); |
DataColumn col = new DataColumn("ID"); |
col.DataType = typeof(int); |
tbl.Columns.Add(col); |
col = new DataColumn("Name"); |
col.DataType = typeof(string); |
tbl.Columns.Add(col); |
col = new DataColumn("Group"); |
col.DataType = typeof(string); |
tbl.Columns.Add(col); |
int size = 15; |
int maxLen = size.ToString().Length; |
for (int i = 1; i <= size; i++) |
{ |
tbl.Rows.Add(new object[] { i, "Name" + i.ToString("D" + maxLen), "Group" + i % 5 }); |
} |
RadGrid1.DataSource = tbl; |
} |
protected void Button1_Click(object sender, EventArgs e) |
{ |
/*RadGrid1.Rebind();*/ |
} |
Then
- with grouping (server side) the postback button will keep state as Rebind command has been commented out, but if Rebind command is activated the collapsed section information get lost
- with grouping ( still server side ) acting on the sorting reset the collapsed section as well.
- with grouping (client side) selected row and collapsed area are lost as well.
On key Feature page the #19 provide us the following : "an unique feature of Telerik RadGrid is the ability to preserve its appearance, group-by state, sorting, current page, edit or selected state, and resizing after postbacks"
Some links concerning previous built are available like Client-Side Row Selection Persisted With Paging, Persist Groups Expanded State on Rebind .. but don't know if they are still valuable for the last release.
Could someone clarify the situation on what is available / built-in and what should be done manually or not, in order to preserve ALL state, in case of server side and client side usage. ( a kind of matrix would be fine ... plus some links on how to do stuff manually, pointing to avaliable threads like the two above.) A grid demo including all available stuff would be nice as well.
Many thanks in advance for your time.