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