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

Re-using OnRowContextMenu client event

2 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 19 Oct 2011, 05:20 PM
Hello,

I have a RadGrid instance that uses the OnRowContextMenu client event to show a pop-up menu. It works perfectly.

However, the right-click context menu behavior isn't always intuitive to my users - so I'd like to add a small drop-down image to each row (in a specific column). When the drop-down image is left-clicked, I would like the "OnRowContextMenu" behavior to be invoked.

How can I accomplish this task?

2 Answers, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 24 Oct 2011, 04:27 PM
Hi Mark,

Thank you for contacting us.

In order to achieve your goal, you should add OnClientClick event handler for every button in the grid. This should be done from code behind in ItemDataBound event handler of RadGrid. As parameters you should pass "this", "event", and "itemIndexHierarchical" for the current item. In the client click handler you could use the logic from this online demo to show the menu.

I have created sample project based on the aforementioned approach. Give it a try and let me know if I can assist you any further.

Best wishes,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Mark
Top achievements
Rank 1
answered on 24 Oct 2011, 06:29 PM
Thanks very much for your assistance.
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Mark
Top achievements
Rank 1
Share this question
or