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 selected records in a GroupingGrid with NestedTables

Thread ID:

Created:

Updated:

Platform:

Replies:

11222 Feb 27,2004 12:34 PM UTC Mar 6,2004 01:10 PM UTC WinForms 1
loading
Tags: Grouping
Beau Tateyama
Asked On February 27, 2004 12:34 PM UTC

Hi, How can I get the selected records(rows) in a grouping grid with a NestedTable? How can I get any selected records? thanks, -beau

Administrator [Syncfusion]
Replied On March 6, 2004 01:10 PM UTC

In a flat groupinggrid, you can get the selections in this manner.
private void button2_Click(object sender, System.EventArgs e) 
{ 
	GridRangeInfoList rangeList = this.gridGroupingControl1.TableControl.Selections.GetSelectedRows(true, false); 
	if(rangeList.Count > 0) 
	{ 
		foreach(GridRangeInfo range in rangeList) 
		{ 
			for(int row = range.Top; row <= range.Bottom; ++row) 
			{ 
				Console.WriteLine(this.gridGroupingControl1.Table.DisplayElements[row].ToString()); 
			} 
		} 
	} 
} 
With the nested tables, you need to get the child tablecontrol you want, and do the same type of thing. But there is a problem that there is only one Selection collection for each child level, and this will cause selections in one child to be seen in other children as the same level.
private void button2_Click(object sender, System.EventArgs e) 
{ 
	GridTableControl gtc = this.gridGroupingControl1.GetTableControl("ChildTable"); 
	GridRangeInfoList rangeList = gtc.Selections.GetSelectedRows(true, false); 
	if(rangeList.Count > 0) 
	{ 
		foreach(GridRangeInfo range in rangeList) 
		{ 
			for(int row = range.Top; row <= range.Bottom; ++row) 
			{ 
				Console.WriteLine(gtc.Table.DisplayElements[row].ToString()); 
			} 
		} 
	} 
} 

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

;