I have a ultraGrid that creates a category called Groups and within those Groups are Users.
How do I check to see if a Group is right-clicked or a User is right-clicked?
Save the right click location in the mouseup event (in my code below: lastRightClickLocation).
Before the context menu is shown, Use this code:
UIElement uiElement = grid.DisplayLayout.UIElement.ElementFromPoint(lastRightClickLocation);
if (uiElement != null)
{
var row = uiElement.GetContext(typeof(UltraGridRow)) as UltraGridRow;
if (row != null)
if (row.Band.Index == 0)
// first band
else
// second band
}
Thanks sir,
(this.ultraGridUsers.Selected.Rows[0].Band.Index == 0)
was all I needed :)