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

[Solved] Context Menu inconsistent behavior

3 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kernelk
Top achievements
Rank 1
kernelk asked on 11 Jul 2013, 11:01 PM
Hi, I am somewhat new to working with these controls, so I am probably missing something.

We have a project that has multiple RadMultiPage/RadPageView/RadGrid controls. I am trying to implement a context menu for some of the grids to create a cell edit menu item. I have some existing examples and looked at examples on this site. I am seeing a behavior in some grids that when we right-click on empty space of the cell, the menu item shows. But if we right-click on the cell text data, the menu doesn't show at all (only show the browser default conext menu). Strangely, in other grids the exact opposite behavior happens. If we right-click on empty space of a cell, the menu doesn't show. But if we right-click on the text data of the cell, the menu items appear.

I tried searching this forum and didn't find anything matching this issue yet. I have tried comparing the RadContextMenu definition and the grid's ClientSettings/ClientEvents and don't see any major difference. Is this where I should be looking?

Telerik.Web.UI 2012.3.1308.40

Browsers: IE 8, FF 22

Thanks,

3 Answers, 1 is accepted

Sort by
0
kernelk
Top achievements
Rank 1
answered on 15 Jul 2013, 09:52 PM
I have some images to clarify the issue:

Scenario 1: (clicking on cell text does not show context menu)

Scenario 2: (clicking on cell but not on cell text does not show context menu)

Any idea what is going on here?
0
kernelk
Top achievements
Rank 1
answered on 16 Jul 2013, 12:06 AM
Ok, I found the issue for scenario 1.

My event handler function calls "args.get_domEvent().target.cellIndex" and when the cell text is right clicked it comes back undefined.

I am using this index to get the column name.
0
kernelk
Top achievements
Rank 1
answered on 16 Jul 2013, 01:57 AM
Ok, I found out a way to get the selected cells column name. I first handle the OnCellSelected event and store the name in a hidden input. Then I can access the value from the OnRowContextMenu handler. Seems like there should be an easier way, but this works for now.
Tags
Grid
Asked by
kernelk
Top achievements
Rank 1
Answers by
kernelk
Top achievements
Rank 1
Share this question
or