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

DataForm - AutoCommit & EditEnded Event

3 Answers 47 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
jen
Top achievements
Rank 1
jen asked on 30 Jun 2015, 07:19 PM

version: 2014.3.1202.45

On a dataform with AutoCommit = True....

Am I correct in assuming that means that, when the user is editing an item and then navigates to another item, the dataform should commit the current edit before changing the current item? Likewise, if False, the dataform should cancel the edit, and return the object to its original values.

If that is true, then I would expect to see an EditEndingEvent then an EditEndedEvent thrown with the EditAction = EditAction.Commit
(on the flipside, if AutoCommit = false, I would expect to see the same events with EditAction = EditAction.Cancel)

This is not happening. Am I misunderstanding the purpose of this setting?

Goal:
I need the opportunity, before the current item has changed, to validate the edit and to update the database with the changes. If the item does not pass the validation, then I need to be able to cancel the item change, keeping the user on the current item until it is valid, or the user cancels the edit.

In this situation, the datasource is a CollectionViewSource, and the CurrentItem is being changed by the user clicking on a RadGridView connected to the same source.

 

Can anyone provide any insight into making this scenario work properly?

Is it possible that it does work as expected, but I've done something to prevent the AutoCommit from working properly? (like a wrong datasource type or my custom CommandProvider)

 

thanks

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 03 Jul 2015, 01:52 PM
Hello,

Generally, when the AutoCommit property of RadDataForm is True (which is by default), switching to the next item should commit the edit operation for the current item. When this property is set to False, the user should commit the operation "manually" by pressing the Ok button (the CommitEdit command should be executed). I would suggest you to check this help article where you can find more information about the AutoCommit setting.

I hope this helps.

Regards,
Yoan
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
jen
Top achievements
Rank 1
answered on 03 Jul 2015, 01:57 PM

If that is true, then I would expect to see an EditEndingEvent then an EditEndedEvent thrown with the EditAction = EditAction.Commit. 

This is not happening. I need this event to be thrown so I can do my validation. Why would you commit an edit without throwing the event saying that its occurred?

How can I achieve my validation requirements?

0
Yoan
Telerik team
answered on 03 Jul 2015, 02:16 PM
Hi,

I was not able to reproduce this problem. I have attached my test project. Please give it a try and let me know how it works at your side.

Regards,
Yoan
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
DataForm
Asked by
jen
Top achievements
Rank 1
Answers by
Yoan
Telerik team
jen
Top achievements
Rank 1
Share this question
or