We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

MouseDown events

Here''s what I''m trying to do ... I want my XPMenus PopupMenu to display whenever a user right-clicks on the grid. The catch is when a cell has been activated for editing - the MouseDown is going to the cell renderer. I read the KnowledgeBase article : Q10465 - Info: How to capture Mouse and Key events when the textbox cell is in active edit state? That allowed me to trap the mouse click and do the following : if (this.AffectEditToolBar && e.Button == MouseButtons.Right && this.CurrentCell.IsEditing) { this.CurrentCell.EndEdit(); OnMouseDown(e); return; } I have just one more thing to figure out - I still have to right-click a second time to get the grid to register the right-click. Is there any way in the code above to get the grid to respond to the first right-click? Thanks!

3 Replies

AD Administrator Syncfusion Team June 14, 2004 06:01 AM UTC

Can you just show the menu yourself in this code when you catch the first right click?


LS Lori S. Pearsall June 15, 2004 02:23 AM UTC

Yes, I could. But I was trying to not be responsible for closing it too.


AD Administrator Syncfusion Team June 15, 2004 07:40 AM UTC

I may be wrong, but I think the context menu will close itself when you click a menu item or move off the menu no matter how it is opened. Did you try calling contextmenu.Show where you wanted to somehow trigger another mousedown to see how it works?

Loader.
Up arrow icon