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
close icon

Getting selection in GGC

Ok, I have the selection mode of my GGC set to "Any" which basically allows them to select similarly to Excel.

I would like to be able to capture what cells they have selected and then get the rows from those cells...

No idea how to do this...is there an event that is fired when they select some cells (SelectedRecordsChanged doesn't fire)? Is there a property I can loop through?

Thanks,
David

1 Reply

JJ Jisha Joy Syncfusion Team September 14, 2009 11:48 AM UTC

Hi David,

You could get the selected range and loop through the selected rows of GridGroupingControl. See the code:

private void button1_Click(object sender, EventArgs e)
{

GridRangeInfoList list = this.gridGroupingControl1.TableControl.Selections.GetSelectedRows(true, true);

foreach (GridRangeInfo range in list)
{
Console.WriteLine(range.ToString());
for (int j = range.Top; j <= range.Bottom; j++)
{
Table table = this.gridGroupingControl1.Table;
Element el = table.DisplayElements[j];

Record r = el.ParentRecord;
Console.WriteLine(r.ToString());

}
}

}


Please let me know if this helps.

Regards,
Jisha

Loader.
Live Chat Icon For mobile
Up arrow icon