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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get multi-selected record rows

Thread ID:

Created:

Updated:

Platform:

Replies:

30313 Jun 15,2005 06:05 PM UTC Jun 16,2005 05:25 PM UTC Windows Forms 2
loading
Tags: GridControl
Lan Mo
Asked On June 15, 2005 06:05 PM UTC

I have a GGC form with multi-selection. How I can loop through selected rows to get a field or column''s "Section_ID" value when I click a OK button? thanks, Lan

Administrator [Syncfusion]
Replied On June 15, 2005 07:20 PM UTC

If you have set this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended; this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None; to turn on the selection support, then you can use this code:
private void button1_Click(object sender, System.EventArgs e)
{

	foreach(SelectedRecord r in this.gridGroupingControl1.Table.SelectedRecords)
	{
		Console.WriteLine(r.Record.GetValue("Section_ID"));
	}
}

Lan Mo
Replied On June 16, 2005 05:25 PM UTC

thank you. It works. >If you have set > >this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended; >this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None; > >to turn on the selection support, then you can use this code: >
>private void button1_Click(object sender, System.EventArgs e)
>{
>
>	foreach(SelectedRecord r in this.gridGroupingControl1.Table.SelectedRecords)
>	{
>		Console.WriteLine(r.Record.GetValue("Section_ID"));
>	}
>}
>

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

;