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

DataFormCommandProvider - AddNew

3 Answers 64 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
jen
Top achievements
Rank 1
jen asked on 03 Jul 2015, 05:38 PM

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? 

3 Answers, 1 is accepted

Sort by
0
jen
Top achievements
Rank 1
answered on 03 Jul 2015, 07:34 PM

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.

0
jen
Top achievements
Rank 1
answered on 07 Jul 2015, 03:31 PM

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

Anyone have an idea what is going on?

0
Stefan
Telerik team
answered on 08 Jul 2015, 11:25 AM
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
Tags
DataForm
Asked by
jen
Top achievements
Rank 1
Answers by
jen
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or