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. Image for the cookie policy date

GridGroupingControl - Multi-Rows select and Right click problem.

Hi All, 1. I have a GGC. When select multiple rows using keyboard/mouse and right click, I am only left with the last selected rows. All other rows are de-selected. I want to have all the selected rows as I want to do combined operation. 2. Also, without holding the shift key, if I just hold the left mouse button and move the mouse on the grid, it selects multiple rows. How to avoid this? Rgds Rajani Kanth

1 Reply

AD Administrator Syncfusion Team November 17, 2005 12:47 PM UTC

1) Setting these properties: gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None; gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended; //or MultiSimple gridGroupingControl1.TableModel.Options.SelectCellsMouseButtonsMask = MouseButtons.Left; should prevent the right click from affecting the selections. 2) Not selecting records as you drag the leftmousedown is not one of the standard SelectionModes found in a ListBox. So, you will have to handle an event to try to implement this behavior. Here is a try at this with the canceling the SelectedRecordChanging event when you do not want the record selected. It may need to be further tweaked to get the exact behavior you want, but this is the event you will likely used to get it.
private SelectedRecord firstSelectedRecord = null;
private void gridGroupingControl1_SelectedRecordsChanging(object sender, SelectedRecordsChangedEventArgs e)
{
	if( e.Action == SelectedRecordsChangedType.Added 
		&&  0 == (Control.ModifierKeys & Keys.Shift))
	{
		if(firstSelectedRecord != null && firstSelectedRecord != e.SelectedRecord)
		{
			e.Cancel = true;
			return;
		}
	}
	firstSelectedRecord = e.SelectedRecord;
}

Loader.
Live Chat Icon For mobile
Up arrow icon