GridGroupingControl: How to implement Cancel.

Hello. Please tell me, how to leave the form with control, if the input is not complete (or not correct). I try .CancelEdit() in Cancel button handler, but control cannot leave focus, cause cannot validate input. So, how to implement Cancel. Thank you. Vadim.

1 Reply

AD Administrator Syncfusion Team June 28, 2004 08:21 AM UTC

One way you can do this is to handle the TableControlCurrentCellValidating event, and if you are clicking on your cancelButton, call CancelEdit on the CurrentRecordManager.
private void gridGroupingControl1_TableControlCurrentCellValidating(object sender, GridTableControlCancelEventArgs e)
{
	if(this.cancelButton.Bounds.Contains(this.PointToClient(Control.MousePosition))
		&& Control.MouseButtons == MouseButtons.Left)
	{
		if (this.gridGroupingControl1.Table.CurrentRecordManager.IsEditing)
		{
			this.gridGroupingControl1.Table.CurrentRecordManager.CancelEdit();
		}
	}
}

Loader.
Up arrow icon