My project using CSLA 4. I am using a GridView to binding and update data. However when I update data after user edit on gridview. I always get an error : "Edit level mismatch in AcceptChanges"
The way I done it is:
Bars_Coll items = Bars_Coll.GetBar_Coll();
gridview.datasource = items;
after user edit a cell. I update by:
This is the way that I learned from thread: http://forums.lhotka.net/forums/p/11468/53194.aspx
Not quite sure what you want to accomnplish but it seems you should rather use the DynamicRootBindingList stereotype that will automatically save when user moves to a new row.
This error message is a classic one in Windows Forms as you cannot call Save on an object that has active databinding. You must always make sure that the object is not bound to any datasource/bindingsource before you can save an object. And also remember that Save returns a new instance of the obnect to "rebind" to the UI.
When DataBinding is active it will call BeginEdit/EndEdit/CancelEdit a many times ("under the hood") and DataBinding assumes it has full control of the actual object. See also: http://msdn.microsoft.com/en-us/library/system.componentmodel.ieditableobject(v=vs.110).aspx
Copyright (c) Marimer LLC