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: CancelEdit.

Thread ID:

Created:

Updated:

Platform:

Replies:

16054 Jul 5,2004 03:35 AM Jul 5,2004 04:44 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 5, 2004 03:35 AM

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

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.

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.

;