Hello,
Currently i have a grid and i have a _ClickCell event on that grid. I use this event to see if the user has clicked on any cell in one specific column and perform some actions based on that. I also have a summary row for that column. Now this event is not getting called on clicking the summary row.
How do i capture the Summary row click event?
Thanks in advance,
Shail
Hi Shail,
No cells in a summary row, so that event won't fire. There's no specific event for clicking on summaries. You'd have to use MouseUp or MouseDown and then use the UIElements to determine what was clicked. Or you looking for the summary row or a particular summary value? Which one you want will determine which UIElement you should look for. It might also depend on how the summaries are laid out (aligned to a column or aligned left/right/center).
Hello Mike,
Thanks for the reply. I am looking for a particular summary value and also the summaries are aligned to a column.
And i also need to know which column was clicked, if possible in the same event.
Thanks
Okay, so then your code would look something like this:
private void ultraGrid1_MouseUp(object sender, MouseEventArgs e) { var grid = (UltraGrid)sender; UIElement element = grid.DisplayLayout.UIElement.LastElementEntered; if (null == element) return; var summaryValueUIElement = element as SummaryValueUIElement; if (null == summaryValueUIElement) summaryValueUIElement = element.GetAncestor(typeof(SummaryValueUIElement)) as SummaryValueUIElement; if (null == summaryValueUIElement) return; // If we get here, the user clicked on a summary value UIElement. Debug.WriteLine(summaryValueUIElement.SummaryValue.Value); }
Thats exactly what i need. Works like a charm ... Thanks Mike.