I have a RadGrid with 3 levels of hierarchy declared as below (some markup left out for readability)
<telerik:RadGrid ID="RadGrid1" |
runat="server" |
AllowSorting="True" |
Skin="Office2007" |
ShowStatusBar="True" |
GridLines="None" |
DataSourceID="SQLDataSource1" |
AutoGenerateColumns="False" |
EnableViewState="true"> |
<MasterTableView HierarchyLoadMode="ServerBind" |
EnableNoRecordsTemplate="true" |
DataKeyNames="PartGroupID,PartGroupParentID" |
Width="100%" |
ShowHeader="true" |
AllowPaging="false"> |
<SelfHierarchySettings ParentKeyName="PartGroupParentID" |
KeyName="PartGroupID" |
MaximumDepth="10" /> |
Users will expand/collapse and collapse the structure, but will also modify the data in the grid. When the data is modified, the RadGrid needs to rebind.
RadGrid1.Rebind(); |
Unfortunately when this happens the grid either collapses fully or expands fully depending on whether the
<MasterTableView HierarchyDefaultExpanded="true" |
is set or not.
What I want is for the grid to maintain its expanded/collapsed state after rebinding, otherwise the user has to expand collapse the grid again to navigate back to node they were editing before the ReBind() was called.
Is there any way to preserve the state, short of rolling my own code?
Thanks,
Malcolm