1 year ago

#204370

test-img

Prasad Gavande

How to get context item menu position when right click in ToolStripMenuItem_Click function relative to Grid?

I have ultraWinGrid, I want to copy cell's value to clipboard. For that, I want to get the X position of context menu when user right clicks on the grid. I want to get this position in ToolStripMenuItem_click function.

For that, I am taking grid's column width

int column1Width = myGrid.DisplayLayout.Bands[0].Columns[0].CellSizeResolved.Width; 

it will return width of column1. Then I want to get the cursor position with respect to Grid. I tried to get the position of cursor using

Cursor.Position.X

This is returning position with respect to whole screen but I want position with respect to grid in which user has right clicked.

Once I get the position of cursor, I will loop through selected row, then check position of cursor and width of column and accordingly get the cell's value and copy that to clipboard.

c#

grid

contextmenu

ultrawingrid

toolstripmenu

0 Answers

Your Answer

Accepted video resources