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.

Detecting status of new row

Thread ID:





14953 Jun 8,2004 02:46 PM Jun 8,2004 03:30 PM Windows Forms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On June 8, 2004 02:46 PM

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 03:30 PM

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");


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.