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
405
Differentiate between Row click and Header click
posted

Hi,

How can I differentiate when a user click Row inside the grid or its header?

I need this information on UltraGrid Click Event, Thanks.

 seems like ActiveRow is not the information...

Parents
  • 2334
    Verified Answer
    posted
    Point cp = Cursor.Position;
    Point p = grid.PointToClient(cp);
    UIElement elem = grid.DisplayLayout.UIElement.ElementFromPoint(p);

    RowUIElement rowElem = elem.GetAncestor(typeof(RowUIElement)) as RowUIElement;

    if (rowElem != null)
    {
    // row was clicked
    }
    else
    {
    HeaderUIElement headerElem = elem.GetAncestor(typeof(HeaderUIElement)) as HeaderUIElement;
    if (headerElem != null)
    {
    //header was clicked
    }
    }
Reply Children
No Data