DataFormCommandProvider - AddNew

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

    Posted 03 Jul 2015 Link to this post

    I have a dataform using a custom DataFormCommandProvider. The CommandProvider has an overriden CanAddNewExecute() function that always returns true.

    When I first go to the page with this control I can Add New items all I want. However once I edit an item, and commit or cancel the edit, the add new button (which is still enabled) stops working. 


    In debug I can see the 
    CommandProvider's AddNew() function is getting called; the only difference is in the beginning the Dataform.CanAddItems property is true. After the Edit, the Dataform.CanAddItems property is false. I believe that while it is false it will not do the AddNewItem functionality.

     

     How can I get the Dataform.CanAddItems property back to being true after an edit, so I can continue adding items? 

  2. jen
    jen avatar
    63 posts
    Member since:
    Jun 2009

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

    I am seeing this same behaviour when not using the custom DataFormCommandProvider as well. 
    Could it be an issue with the underlying source collection?

    I am using an ObservableCollection, exposed through a CollectionViewSource

    We can add new until we edit, then we can no longer add new.

  3. UI for WPF is Visual Studio 2017 Ready
  4. jen
    jen avatar
    63 posts
    Member since:
    Jun 2009

    Posted 07 Jul 2015 in reply to jen Link to this post

    looking a bit deeper, I notice this is only happening when the edit is canceled.

    Anyone have an idea what is going on?

  5. Stefan X1
    Admin
    Stefan X1 avatar
    514 posts

    Posted 08 Jul 2015 Link to this post

    Hi jen,

    I am writing to inform you that we have replied you in your 950058 ticket. In order to avoid double posting, I would kindly ask you to continue any further communication regarding this case in it.

    Best Regards,
    Stefan
    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