Hi Q,
If you set the SelectCellsMouseButtonsMask property to LeftMouseButton than the grid will cancel the Right mouse click in a cell. To capture this event you can use the gridDataBoundGrid1.MouseDown event. In the event handler you can clear the selections programmatically and move the CurrentCell to the cell on which the mouse is clicked.
Below is the code snippet.
void gridDataBoundGrid1_MouseDown(object sender, MouseEventArgs e)
{
//Getting the mouse location
int row, col;
Point p = gridDataBoundGrid1.PointToClient(Control.MousePosition);
bool validRowCol = gridDataBoundGrid1.PointToRowCol(p, out row, out col);
if (validRowCol && row > 0 && col > 0)
{
if (!gridDataBoundGrid1.Selections.Ranges.AnyRangeIntersects(GridRangeInfo.Cell(row, col))
&& e.Button == MouseButtons.Right)
{
gridDataBoundGrid1.Selections.Clear(true);
gridDataBoundGrid1.CurrentCell.MoveTo(row, col, GridSetCurrentCellOptions.None);
}
}
}
Here is a sample that implments the similar functionality.
http://websamples.syncfusion.com/samples/Grid.Windows/33731/mai'>http://websamples.syncfusion.com/samples/Grid.Windows/33731/main.htm">http://websamples.syncfusion.com/samples/Grid.Windows/33731/mai n.htm
Best regards,
Haneef