Row Header Click

6 posts, 1 answers
  1. Frank
    Frank avatar
    24 posts
    Member since:
    Jan 2007

    Posted 26 Jan 2012 Link to this post

    Hi telerik,

    I want to display a context menu only if a row header was clicked. I got as far as HitTesting the click in ContextMenu_Opening but the list of Elements under the mouse shows nothing like a "GridViewRowHeader".

    So how do I test for "RowHeader clicked"?

    Thx,
    bluewater
  2. Frank
    Frank avatar
    24 posts
    Member since:
    Jan 2007

    Posted 31 Jan 2012 Link to this post

    Nobody at all? Or am I missing the blindingly obvious and you are trying to spare me embarassment? Either way, your help still much appreciated...
  3. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 31 Jan 2012 Link to this post

    Hi Frank,

    Using the header property of the column you can place a textblock inside the column header. Set the text property to the desired text then set a context menu for this textbox and you will not need to handle any events.

    Regards,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  4. Frank
    Frank avatar
    24 posts
    Member since:
    Jan 2007

    Posted 31 Jan 2012 Link to this post

    Thank you Pavel,

    while this is probably a better way of raising column-dependent context menus than my current method, it does not seem to solve my *row* header issue, i.e. raise a context menu for when the row header (no column) was clicked.

    Background: I am offering the user some operations for the entire row ("Copy Row", "Make this row a parent" etc.) and the best place to do this is, I believe, a context menu attached to the row header.

    Could you think of any alternative solutions?
  5. Answer
    Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 01 Feb 2012 Link to this post

    Hello Frank,

    It was my mistake. I thought you were speaking about column headers.
    I am attaching a small runnable project demonstrating a way to add a right click context menu to the row indicator.

    Please find it attached.

    All the best,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Frank
    Frank avatar
    24 posts
    Member since:
    Jan 2007

    Posted 01 Feb 2012 Link to this post

    Brilliant. Thank you very much.
Back to Top