Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
How to read the displayed value in a GroupBy row?
posted

- 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

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    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);
                }

Children