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.
Up arrow icon