We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Multiple row selection and right mouse click

Thread ID:

Created:

Updated:

Platform:

Replies:

24620 Feb 8,2005 10:22 AM Feb 8,2005 04:27 PM Windows Forms 3
loading
Tags: GridControl
Rick
Asked On February 8, 2005 10:22 AM

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.

Administrator [Syncfusion]
Replied On February 8, 2005 11:03 AM

Try setting this property. this.grid.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;

Rick
Replied On February 8, 2005 02:36 PM

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

Administrator [Syncfusion]
Replied On February 8, 2005 04:27 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;