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
close icon

MultiSelect in GridGroupingControl

Hi, I m having problems deleting a row when setting the TableOptions.ListBoxSelectionMode property of the GridGroupingControl. If this property is set when I select a row and then Press delete the grid only deletes the first column and not the whole row. The same happens when I try to Copy my selection - only the selected cell is copied. Jdp

1 Reply

AD Administrator Syncfusion Team March 30, 2005 03:19 PM UTC

Try handling the TableControlCurrentCellKeyDown event.
private void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e)
{
	if(e.Inner.KeyCode == Keys.Delete)
	{
		Record rec = e.TableControl.Table.CurrentRecord;
		if(rec != null)
		{
			int i = e.TableControl.Table.FilteredRecords.IndexOf(rec);
			if(i > 0)
			{
				e.TableControl.Table.CurrentRecord = e.TableControl.Table.FilteredRecords[i-1];
				e.TableControl.Table.CurrentRecord.SetSelected(true);
			}
			rec.Delete();
			e.Inner.Handled = true;
		}
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon