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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Detecting status of new row

Thread ID:

Created:

Updated:

Platform:

Replies:

14953 Jun 8,2004 06:46 PM UTC Jun 8,2004 07:30 PM UTC WinForms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 8, 2004 06:46 PM UTC

I am validating fields in a row in a databound grid at the rowleave event. If a user is creating a new row and then changes his mind part way through, he cannot leave the row without meeting the validation criteria first. I need to be able to check the new row status, at the rowleave event, so that I can see if the ESC key has been pressed to cancel the new row entry. Then I can allow the user to leave without validation. How do I do this?

Administrator [Syncfusion]
Replied On June 8, 2004 07:30 PM UTC

If you have this property set so the cell is active when it become current, this.gridDataBoundGrid1.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent; then you can catch an Esc on the AddNewRow by handling this event.
private void gridDataBoundGrid1_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e)
{
	Keys keyCode = (Keys)((int)e.Msg.WParam) & Keys.KeyCode;
	if(keyCode == Keys.Escape && this.gridDataBoundGrid1.Binder.IsAddNew)
		Console.WriteLine("Escape on addnew row");
}

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

;