This is a migrated thread and some comments may be shown as answers.

Row Header Click

5 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 26 Jan 2012, 08:24 AM
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

5 Answers, 1 is accepted

Sort by
0
Frank
Top achievements
Rank 1
answered on 31 Jan 2012, 10:05 AM
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...
0
Pavel Pavlov
Telerik team
answered on 31 Jan 2012, 10:14 AM
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 >>

0
Frank
Top achievements
Rank 1
answered on 31 Jan 2012, 10:29 AM
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?
0
Accepted
Pavel Pavlov
Telerik team
answered on 01 Feb 2012, 06:34 PM
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 >>

0
Frank
Top achievements
Rank 1
answered on 01 Feb 2012, 06:48 PM
Brilliant. Thank you very much.
Tags
GridView
Asked by
Frank
Top achievements
Rank 1
Answers by
Frank
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or