This is a migrated thread and some comments may be shown as answers.

RowEditEnded event no fired when using escape key

3 Answers 267 Views
GridView
This is a migrated thread and some comments may be shown as answers.
m v klingeren
Top achievements
Rank 1
m v klingeren asked on 11 Nov 2010, 11:53 AM
According to the documentation

"There are several ways to commit the new data and both of them will raise the RowEditEnded event. The first one occurs when the user presses Enter, the second when the CommitEdit() method is called and the last when another row is selected. The adding operation can also be cancelled by pressing Escape or calling the CancelEdit() method. In this case the RowEditEnded event will be raised again."

Unforutnately, the RowEditEnded is not raised when a user pressed the escape key..


My grid is bound to a RIA DomainService

this happens with Q3 (latest available release, as of speaking)

is this a bug?

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 11 Nov 2010, 12:53 PM
Hello m v klingeren,

Actually, when you click the escape button once - only the current cell leaves the edit mode, but not the full row. Now, if you click the escape button again - the row will leave the edit mode and the RowEditEnded event will fire.
If you want to change that behavior you might need to read this blog post.

All the best,
Veselin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
gaurav
Top achievements
Rank 1
answered on 12 Aug 2019, 07:29 PM

I am facing a similar problem. Whenever I change something in my cell and directly press the close button of the window, the RowEditEnded does not fire and all my changes are lost. Is there a I can ensure that event is fired even if the close button is pressed directly?

 

0
Martin Ivanov
Telerik team
answered on 15 Aug 2019, 12:26 PM

Hello Gaurav,

The RowEditEnded will get fired on the second press of the Escape key. The first time the cell edit is ended. In this case you can use the CellEditEnded event, if this works for you. If it doesn't, you can implement a custom keyboard command provider and override its ProvideCommandsForKey() method. There you can replace the default command that first cancels the cell edit, and you can directly cancel the row edit. For example:

public class CustomKeyboardCommandProvider : DefaultKeyboardCommandProvider
{
	public CustomKeyboardCommandProvider(GridViewDataControl dataControl) : base(dataControl)
	{
	}

	public override IEnumerable<ICommand> ProvideCommandsForKey(Key key)
	{
		if (key == Key.Escape)
		{
			var commands = new List<ICommand>();
			commands.Add(RadGridViewCommands.CancelRowEdit);
			return commands;
		}
		return base.ProvideCommandsForKey(key);
	}
}

Regards, Martin Ivanov
Progress Telerik

Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
m v klingeren
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
gaurav
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or