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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGroupingControl: CancelEdit.

Thread ID:

Created:

Updated:

Platform:

Replies:

16054 Jul 5,2004 07:35 AM UTC Jul 5,2004 08:44 AM UTC WinForms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 5, 2004 07:35 AM UTC

Hello. You already help me with implementation of Cancel-button functionality. It works if the user pressed Cancel, when the cell is currently editing has focus and caret. But, after user try to press OK button with the incompleted row, exception window shows and current cell lost focus. Errorprovider appear, but without focus on the cell. In this state CancelEdit doesn''t work. Further validation failed and form won''t close by Cancel. Please help me with this state of window.] Reference: http://www.syncfusion.com/support/Forums/message.aspx?MessageID=15775 Thank you.

Administrator [Syncfusion]
Replied On July 5, 2004 08:44 AM UTC

I think moving the CurrentRecordManager.CancelEdit code from your cancel button handler to the gridGroupingControl Leave event will allow the cancel to work in this case as well as the previous case.
private void cancel_Click(object sender, System.EventArgs e)
{
	 this.Close();
}

private void gridGroupingControl1_Leave(object sender, System.EventArgs e)
{
	if(this.cancel.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.

Warning Icon 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.Close Icon

;