Activate cell in grid on right click

I am using syncfusion(2.0.5.1) GridControl in my application. Currently I activate the cell by clicking on the cell. The gridcontrol is associated with the context menu. By right clicking on the cell the context menu will be visible. I need to just right click on a cell and it should activate the particular cell and display the context menu. Is there any properties avialable in gridcontrol to specify this. Kindly let me know. Thanks Rohith

3 Replies

ST stanleyj Syncfusion Team December 16, 2005 10:31 AM UTC

Hi Rohith, See if this helps. private void Form1_Load(object sender, System.EventArgs e) { this.gridControl1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left; this.gridControl1.MouseDown += new MouseEventHandler(gridControl1_MouseDown); } int row, col; private void gridControl1_MouseDown(object sender, MouseEventArgs e) { if(e.Button == MouseButtons.Right) { GridCurrentCell cc = this.gridControl1.CurrentCell; Point pt = new Point(e.X, e.Y); this.gridControl1.PointToRowCol(pt, out row, out col); this.gridControl1.CurrentCell.MoveTo(row, col); this.contextMenu1.Show(this.gridControl1, pt); } } Best Regards, Stanley


AD Administrator Syncfusion Team December 16, 2005 10:50 AM UTC

Hi stanley, Is this the only way to make the cell active on right click. I do not want to do this by handling the mouse click event. Kindly let me know if there are any properties available in gridcontrol which will set this. Thanks Rohith


ST stanleyj Syncfusion Team December 16, 2005 11:13 AM UTC

Hi Rohith, Try setting this property, see if this helps. this.gridControl1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left | MouseButtons.Right; Best regards, Stanley

Loader.
Up arrow icon