How to get multi-selected record rows

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

2 Replies

AD Administrator Syncfusion Team 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"));
	}
}


LM Lan Mo 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"));
>	}
>}
>

Loader.
Up arrow icon