DataForm - AutoCommit & EditEnded Event

4 posts, 0 answers
  1. jen
    jen avatar
    63 posts
    Member since:
    Jun 2009

    Posted 30 Jun 2015 Link to this post

    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

  2. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 03 Jul 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. jen
    jen avatar
    63 posts
    Member since:
    Jun 2009

    Posted 03 Jul 2015 in reply to Yoan Link to this post

    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?

  5. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 03 Jul 2015 Link to this post

    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
Back to Top