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

ContextMenu only on contents?

1 Answer 35 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 21 Jun 2018, 08:56 PM

I am assigning my grid a context menu.  However, I only want the context menu on the contents of the grid, not on the column nor row headers.  How would I do that?

In case you care, I'm doing this in code using the following:

myGrid.ContextMenuOpening += MyGrid_ContextMenuOpening;
myGrid.ContextMenu = gridCM 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 26 Jun 2018, 01:04 PM
Hi Brad,

There is an SDK example in our GitHub repository which demonstrates how you could use RadContextMenu for RadGridView. If you want to not show the context menu on column or row headers you can check the current clicked element by using GetClickedElement() method of the RadContextMenu. I have modified the project to demonstrate this approach and attached it here. You can additionally modify the approach so it covers all scenarios in your main application.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Brad
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or