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
330
ultraGrid and contextMenuStrip group select
posted

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?

Parents
  • 17259
    Verified Answer
    Offline posted

    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

    }

    }

Reply Children
No Data