Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
11222 | Feb 27,2004 12:34 PM UTC | Mar 6,2004 01:10 PM UTC | WinForms | 1 |
![]() |
Tags: Grouping |
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()); } } } }
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.
This page will automatically be redirected to the sign-in page in 10 seconds.