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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Getting selection in GGC

Thread ID:

Created:

Updated:

Platform:

Replies:

89975 Sep 11,2009 05:15 PM UTC Sep 14,2009 11:48 AM UTC WinForms 1
loading
Tags: GridControl
David Baxter
Asked On September 11, 2009 05:15 PM UTC

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

Jisha Joy [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;