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.
Unfortunately, activation email could not send to your email. Please try again.

GridGroupingControl: How to implement Cancel.

Thread ID:

Created:

Updated:

Platform:

Replies:

15775 Jun 28,2004 03:08 AM Jun 28,2004 04:21 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 28, 2004 03:08 AM

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.

Administrator [Syncfusion]
Replied On 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();
		}
	}
}

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;