Link to home
Start Free TrialLog in
Avatar of JohnRia
JohnRia

asked on

Control a context menu in datagrid

Hello,

I have a context menu in a datagrid and it has several options on it, such as:

Add
Edit
Delete
Move
Print
Cancel

I only want the options to be available if the right click is in the rowheader area of the datagrid. I would then like to select the row the user is pointing at and process the request, unless they already have multiple rows selected, then I would liek ot process all the selected rows. I am having trouble figuring out how to get thing to happen in the correct sequence. If I use the mouse up event of the dg and change the menu items to enabled they do not show up until the next right click. How do I go about doing this?
ASKER CERTIFIED SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JohnRia
JohnRia

ASKER

Alex, that is working great. I did have to add a check for which mouse buttom was pressed in order to allow the user to select multiple rows with the left mouse button. I may still have some issues with what I am tryingto do but at least this problem is solved. Thanks for the help.

JohnRia

Glad you liked it!

Alex :p