GGC - Keep user from selecting new row until current active cell is validated

Is there a way to keep the user from selecting a new row in the GGC when they are currently editing a cell and you need to validate that cell and if it is invalid have the row that contained the current cell keep focus. I currently have the following settings: this.grid.TableOptions.AllowSelection = GridSelectionFlags.None; this.grid.TableOptions.ListBoxSelectionMode = SelectionMode.One;

1 Reply

AD Administrator Syncfusion Team August 17, 2005 06:07 PM UTC

To do record level validation, you can use the CurrentRecordContextChanged event. Here is code that will not let you leave a record if Col1 has a 1 in it.
private void gridGroupingControl1_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e)
{
	if(e.Action == CurrentRecordAction.LeaveRecordCalled)
	{
		GridRecord record = e.Record as GridRecord;
		if(record != null && record.GetValue("Col1").Equals("1"))
		{
			e.Cancel = true;
		}
	}
}

Loader.
Up arrow icon