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: 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 04:21 AM

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.
Live Chat Icon For mobile
Up arrow icon