help with datagrid

  • Thread starter Thread starter Vjay77
  • Start date Start date
V

Vjay77

I have created a datagrid on a form.
I have put a contextmenu on the grid.
Using the mousedown event of the grid I display the contextmenu on
right clicks. The trouble I am having is that if you left click a
cell in the grid then right click the default popup comes up. If I
right click in a cell that is not selected ti works fine and
displayes my popup menu. Any help would be appreciated.
 
The problem is that what you are experiencing is the
default operation of the DataGrid. If a cell is selected,
the standard context menu will display with a right click.
I have solved the problem by selecting the row on a right-
click, and then with the whole row selected, my context
menu will popup on a right click.

I have an article on selecting a row with a rightclick at

http://www.knowdotnet.com/articles/datagridrightmouseselect
..html

If this does not do the job, send me an email and I will
give you additional code from an application that displays
a dialog form on a right click.

HTH
Les

http://www.knowdotnet.com
 
Back
Top