My problem is I'm using an OpenAccess reverse-modelled table as the source for a WPF DataForm.
Everything works great as long as I 'Edit' rows but...
- can't Add (button is disabled)
- can't Delete (button is disabled)
- can't Cancel an edit (button is disable)
Committing an Edit works great. Navigation works Great.
Am I missing a setting in my Model, WPF or in XAML?
Thanks...
6 Answers, 1 is accepted
I have tested the case, but unfortunately I was not able to reproduce the issue. May you take a look at the sample attached to verify whether there are no misunderstandings ?
Regards,
Maya
the Telerik team
I'm running this on VS 2008 so couldn't open the solution (sorry, should have mentioned that).
BUT, I did see the problem.
For the ItemSource you've got ObservableCollection objects. I've got IQueryiable objects (I was using the same type as in the datacontext).
So I changed one of mine to an ObservableCollection and it's working great now.
I had another issue I thought was unrelated that was fixed also. I didn't see a way to have the datacontext use something else in the OpenAccess wizard but I don't guess I really need that now.
Here is a recap of all the 'symptoms' I ran into on the DataForm control using OpenAccess Q2 2011
(for any other new-bies searching the Forum)...
- <FIXED> First Item does not appear in the DataForm Control (hit 'next item' arrow, then 'previous' arrow and there it is)
- <FIXED> Add Button not available on DataForm Control
- <FIXED> Delete Button not available on DataForm Control
- <FIXED> Cancel Button is not available while in Edit Mode on DataForm Control
I'm sure similar issues would be seen in other controls...
Maya (or anyone else), if you could do a quick post to help me understand the behaviors resulting from IQueryable I would greatly appreciate it, there are a couple of those symptoms above that seem odd to have resulted from that.
You may take a look at the CustomersViewModel and check the CollectionChanged event of the ObservableCollection Customers. The logic there is the one responsible for the inserting and deleting the items from the data source. Such event is not present for a IQueryable. Furthermore, it does not provide methods for adding and removing any item. Generally, the idea of IQueryable is to provide queryable data source and build query by expression tree. You may take a look at this article for further reference.
Considering the ability to cancel the changes, you need to implement IEditableObject Interface for your business object. You may run through this article for a hint.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
This is my exact problem as well, can you give me any suggestions as to what might be the issue here?
Thanks,
Wil it be possible to provide a bit more details on your scenario ? Do you work with OpenAccess as well ? Did you manage to get the same behavior on the project attached above ? Which version of RadControls are you working with ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
You Attached a great sample.
Thank You very much
I think you forgot "this.DbContext.SaveChanges();" at the end of Add and Remove methods. am I right?