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.

Getting selected records in a GroupingGrid with NestedTables

Thread ID:

Created:

Updated:

Platform:

Replies:

11222 Feb 27,2004 07:34 AM Mar 6,2004 08:10 AM Windows Forms 1
loading
Tags: Grouping
Beau Tateyama
Asked On February 27, 2004 07:34 AM

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 08:10 AM

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.

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.

;