- i have an ultraWinGrid that is grouped by country, it displays 3 Groupby rows: (for example: Belgium, Austria, Holland)
so when i select a row (country) i want to be able to get the value of that group (Belgium or Austria or Holland).
the following code gives the caption of the groupBy column (this.ultragrid1.Selected.Rows[0].Band.Columns[0].Header.Caption.ToString())
but i need the value.
thanks
Hi,
The code you have here just gets the caption of Column 0. That's nothing to do with the value of the GroupByRow. To get that, you have to first cast the row into the proper type. All the items in the Rows collection are of type UltraGridRow. UltraGridGroupByRow derives from UltraGridRow. So to access the GroupByRow-specific properties, you first have to cast it.
Once you have that, you probably want the Value of the row, but the Description and DescriptionWithSummaries may also be useful:
UltraGridGroupByRow groupByRow = this.ultraGrid1.Selected.Rows[0] as UltraGridGroupByRow; if (null != groupByRow) { Debug.WriteLine(groupByRow.Value.ToString()); Debug.WriteLine(groupByRow.Description); Debug.WriteLine(groupByRow.DescriptionWithSummaries); }
that's it,
Thank you very much.