ViewModelDetail EndEdit not respecting attributes



I'm built a Silverlight 5 application using Telerik's Data Access component. I recently added a detail view using the ViewModelDetail template. Adding a new record works fine, but editing an existing one throw the following error the field OpenAccessGenerated is read-only. The response from the Telerik Support is as follows...

Thank you for the provided sample, we were able to find the causes of the issue. It seems that the Silverlight MVVM template which you are using has a method EndEdit() which doesn't respect the attribute in the class generated by the RIA Service. The property OpenAccessGenerated is a propery descriptor used by the metadata in the OpenAccessContext and is generated by the RIA Service with these attributes:
[Display(AutoGenerateField=false, AutoGenerateFilter=false, Description="OpenAccess Key", Name="-ID-")]
public string[] OpenAccessGenerated
Somehow the EndEdit() method, which is called in the RadGridView_PreparedCellForEdit() method, didn't respect these attributes and try to update the value of the property. Also this method, which is inherited from the abstract class SimpleMvvmToolkit.ViewModelDetailBaseCore is not virtual and cannot be overwritten.

I have a sample app that I can send you... I would attach but i's like 24 m.



tonysneed wrote Oct 31, 2014 at 6:46 PM

I agree that the IEditableObject methods should be made virtual so they can be overriden. That way, you can reflect over the attributes and take the appropriate action.