EndEdit on BindingSource updates DataTable, but ro

2019-04-03 02:14发布

I have a bindingsource which has a datasource which is a datatable.
All the winforms controls has added databindings to the bindingsource

I do a value change in the GUI (writes to the controls' .text property)

then on Save i do following

  bsSending.EndEdit();      

((DataRowView)this.bsSending.Current).Row) now contains the new values, but the RowState is still unchanged. How can this be possible? I haven't any calls to AcceptChanges() before I make the value changes in the GUI

7条回答
何必那么认真
2楼-- · 2019-04-03 03:01

To commit row changes programmatically, call the form's Validate method. If your data source is a BindingSource, you can also callBindingSource.EndEdit.

see IsCurrentRowDirty

查看更多
登录 后发表回答