I have and object on
bindingSource.DataSource = object
I have to implement Save and Revert Changes on a Windows Form
for Revert Changes i have all Items for Properties with DataSourceUpdateMode.Never
and bindingSource.ResetBindings(false);
-> works fine
but for Save I need to make a Commit
bindingSource.EndEdit(); – it doesn’t update my object
and i tried to make
TextEdit.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.OnValidation;
bindingSource.EndEdit();
TextEdit.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.Never;
but it didn’t work,
if i let DataSourceUpdateMode.OnValidation , the Save will work fine , but Revert changes will not work
and I don’t want to make a copy of the object
any ideas?
When you set the
DataSourceUpdateModeenum toNeverand use this method on several controls bound to theBindingSource, there are various problems:http://msdn.microsoft.com/en-us/library/system.windows.forms.binding.writevalue%28v=vs.90%29.aspx
http://weblogs.asp.net/psteele/archive/2006/10/10/Data-Binding-fails-me-again_2E002E002E00_.aspx