The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
Fantastic!
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)?
Rick
ADAdministrator Syncfusion Team February 8, 2005 09:27 PM UTC
Hi Rick,
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)
{
grid.Model.Selections.SelectRange(GridRangeInfo.Row(row), false);
grid.Model.InvalidateRange(GridRangeInfo.Row(row), GridRangeOptions.None);
e.Cancel = true;
}
}
}
Stefan
>Fantastic!
>
>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)?
>
>Rick