I want to enable users to right click a cell (or row) and see a popup menu. I played with the activation event but it doesn't get fired if the user right clicked. It only gets fired when the user left clicks.
Hello,
Yes, I also could not find right-click / context menu events in the Activation / Selection behaviours, but this can easily be addressed by using some javascript CSOM. In this particular code snippet, I am assigning a client-side event for clicking on the first cells of the second row of the grid and checking for right-click. You can use this code to show custom context menu
var grid = $find("<%= WebDataGrid1.ClientID %>"); var gridRow = grid.get_rows().get_row(2); gridRow.get_cell(0).get_element().onmouseup = function(e) { if (!e) e = window.event; if (e.button == 2) { alert("Right Click"); } }
Showing custom popup menu (using UltraWebMenu) is shown in this example:
Hi,
I too am trying to do popup context menu but for a "selected row" for webdatagrid.
In your sample above you assign the onmouseup function to a specific cell "0" in row "2":
Q1: how do i assign a function like this to any row in the grid (but not header or footer rows)? Could you provide a sample code?
Q2: How does the function in Q1 know what row was right-clicked on? Could you provide a sample code?
Q3: how do i change the selected row that was right-clicked on? could you provide a sample code?
Q4: Once the row selection is change via Q3 above, then the popup context menu can get the selected row in the grid - correct?
thanks!
-chris