Radgrid not updating

i found that any errors during update were usually because of: - No primary key in Table - No primary key in Edit view/form (e.g.

Wasn't passing the Row Version from the View to the edit Action, plus I forgot to do the model binding for Row Version.

This caused the error since N - 1 rows were affected due to the trigger deleting one of the child entities itself before entity framework tried to delete it.

From Paul Bellora's comment I had a similar issue but with a twist.

For me the issue was I didn't have the sql table setup correctly.

If you use timestamps, tje object you want to delete needs the PK set and the Row Version Property in order to update it successfully!

I was setting the row Version (timestamp) property, after I have attached the object to the respective Db Set, that's why it didn't work. I ran into this and it was caused by the entity's ID (key) field not being set.

Thus when the context went to save the data, it could not find an ID = 0.

Last modified 05-Nov-2017 03:59