Grouped Columns - clear selection

Hello,

I have a grouping grid with grouped columns. If the row is selected, the following statement to clear any existing grid selection raises an exception

// clear any existing grid selections
grid.TableControl.Selections.Clear();

Exception Raised -
Syncfusion.Grouping.Element get_Item(Int32) - Specified argument was out of the range of valid values.

However, when there are no grouped columns defined, the statement to clear the selection (above) works fine! I am using Syncfusion Essential Suite 2.1.0.50

Is this a known issue?

Thanks
Shipra



1 Reply

AD Administrator Syncfusion Team November 29, 2007 09:43 AM UTC

There were problems reported in TableControl.Selections.Clear back in July-August 2004. They were corrected. If you upgrade to a more recent release, the problem should not occur.

Just some things to try as a work around.

1) try setting grid.TableControl.CurrentCell.MoveTo(-1, -1) before you call Clear.

2) Instead of calling Clear, try this code:

while (this.gridGroupingControl1.TableControl.Selections.Count > 0)
{
this.gridGroupingControl1.TableControl.Selections.Remove(this.gridGroupingControl1.TableControl.Selections.Ranges[0]);
}



Loader.
Up arrow icon