With multiple rows selected (via ctrl click or shift click) on a DBDG, if the right mouse button is clicked to launch a popup menu, the selections are lost and the new selection is the cell the user right mouse clicked on. Is there a way (thru code) to keep previous selections active during right mouse clicks? I know if you hold the ctrl or shift key while right mouse clicking, it keeps the selection, but the Windows standard seems to be that you do not have to hold ctrl or shift.
I''ve tried to check in the SelectionChanging event, but GridSelectionChangingEventArgs does not indicate mouse attributes.
ADAdministrator Syncfusion Team February 8, 2005 04:03 PM UTC
Try setting this property.
this.grid.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;
RIRickFebruary 8, 2005 07:36 PM UTC
Ok, here''s one final question. While having multiple rows selected, how do I get the ctrl click to REMOVE a row from the selection (another Windows standard)?
ADAdministrator Syncfusion Team February 8, 2005 09:27 PM UTC
here is some code that should do this:
this.gridDataBoundGrid1.GridControlMouseDown += new Syncfusion.Windows.Forms.CancelMouseEventHandler(gridDataBoundGrid1_GridControlMouseDown);
private void gridDataBoundGrid1_GridControlMouseDown(object sender, Syncfusion.Windows.Forms.CancelMouseEventArgs e)
int row, col;
GridControlBase grid = (GridControlBase) sender;
if (grid.PointToRowCol(new Point(e.MouseEventArgs.X, e.MouseEventArgs.Y), out row, out col))
if (grid.Model.SelectedRanges.GetRangesIntersecting(GridRangeInfo.Row(row)).Count > 0)
e.Cancel = true;
>Ok, here''s one final question. While having multiple rows selected, how do I get the ctrl click to REMOVE a row from the selection (another Windows standard)?