Hi I am using these methods to save and restore the expanded groups, but i am getting an exception on the line as indicated by the catch, and it leaves one of my groups collapsed. Please can you suggest a solution?
///
/// Stores the currently expanded groups in the GridGrouping Control
/// for later retrieval with RefreshAndRestoreExpandedGroups method.
///
///
The GridGroupingControl on which to operate
public void StoreExpandedGroups()
{
this.expandedBrokerGroups = new ArrayList();
foreach ( Group group in this.linkMonitorGrid.Table.TopLevelGroup.Groups )
{
if ( group.IsExpanded==true )
{
this.expandedBrokerGroups.Add( group.GetFirstRecord().GetValue("RefBrokerID") );
}
}
}
///
/// Refreshes the grid and it''s underlying table, and retrieves any expanded
/// groups previously saved with the StoreExpandedGroups method.
///
///
The GridGroupingControl on which to operate
public void RefreshAndRestoreExpandedGroups()
{
this.linkMonitorGrid.Table.TableDirty = true;
foreach ( Group group in this.linkMonitorGrid.Table.TopLevelGroup.Groups )
{
if ( this.expandedBrokerGroups.Contains( group.GetFirstRecord().GetValue("RefBrokerID") ) )
{
try
{
group.IsExpanded=true;
}
catch {}
}
}
this.linkMonitorGrid.Refresh();
}