Need to process row selection on a right mouse button click popup menu item processing

I have a range of rows selected. Pressing with a RMB on this range causes resetting my selection BEFORE processing TableControlCellClick. I need to somehow have this range when right mouse button pressing processes, when this range is already reset.
Haneef wrote me about _gridGrouping.TableControl.Model.Options.SelectCellsMouseButtonsMask property, which prevent the right button from affecting any selections,
BUT it also prevents TableControlCellClick rasing on right mose button click - so I just can''t have my RMB popup menu appear.
Any ideas how to solve this?

2 Replies

AD Administrator Syncfusion Team August 28, 2006 11:06 PM UTC

Hi Kostya,

You can handle the TableControlMouseDown event instead of TableControlCellClick event and set the context menu on RightClick. The following code snippet demonstrates this technique.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//this.gridGroupingControl1.TableControlMouseDown += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlMouseEventHandler(gridGroupingControl1_TableControlMouseDown);
void gridGroupingControl1_TableControlMouseDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlMouseEventArgs e)
{
if(e.Inner.Button == MouseButtons.Right)
this.contextMenuStrip1.Show(this.gridGroupingControl1, this.gridGroupingControl1.PointToClient(Control.MousePosition));
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Best regards,
Madhan


KB Konstantin Babiy August 29, 2006 09:40 AM UTC

Thank you, Madhan, you helped me so much!

Loader.
Up arrow icon