Hi,
I have a WinGrid where I have a Groupby Header (see picture below).
Is it possible when clicking on one row to retrieve the value of the grouped by column (in the sample the "Donnerstag, 28.. Oktober 2010")?
Thanks in advance if anybody has an idea.
Regards,
Oliver
Do you really want the value only when the user clicks on the row? What if they activate the row using the keyboard?
If you only care about clicking, then using MouseDown as Danko suggested is a good way to go. If you just want to track when the ActiveRow changes, I would do it like this:
private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { UltraGrid grid = (UltraGrid)sender; if (grid.ActiveRow != null && grid.ActiveRow.IsGroupByRow) { UltraGridGroupByRow groupByRow = (UltraGridGroupByRow)grid.ActiveRow; Debug.WriteLine((groupByRow.Value); } }
Either way, you get the value by casting the row into an UltraGridGroupByRow and then using the Value property.
Great! Thanks all for the suggestions!
Rgds,