We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Exception using group.IsExpanded=true

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(); }

3 Replies

JS Jason Southgate December 21, 2004 07:50 AM

The actual exception I get is A first chance exception of type ''System.ArgumentOutOfRangeException'' occurred in syncfusion.grouping.dll Additional information: Specified argument was out of the range of valid values.


AD Administrator Syncfusion Team December 21, 2004 01:24 PM

I think this must be related to other special settings in your grid. Can you post your application / a sample that shows the problem? Thanks, Stefan


JH Jason Hales January 7, 2005 07:13 AM

If it helps I''ve had similar problems to do with storing the expanded groups. If you set TableDirty and SummariesDirty: syncGrid.Table.TableDirty = true; syncGrid.Table.SummariesDirty = true; then enumerating though the groups will return false for group.IsExpanded when is was previosuly true. I''ve got roud this by storing the expanded groups and then setting TableDirty and SummariesDirty to true Jason >I think this must be related to other special settings in your grid. Can you post your application / a sample that shows the problem? > >Thanks, >Stefan >

Loader.
Live Chat Icon For mobile
Up arrow icon