BindingSource.EndEdit and Position -
11-03-2007
, 04:11 PM
When I call BindingSource.EndEdit on one of the BindingSources of my
application, it correctly finishes the addition of the new row but
surprisingly it also resets its Position to zero (and so also changes the
object referenced by its Current property to the first item on the DataView
that underlies).
I would like to know if this is an expected behavior. It does not happen
with all my BindingSources.
I've handled the BindingSource.CurrentChanged event and I see something like
this in the call stack:
MyForm.bindingSource_CurrentChanged
[Native to managed]
[Managed to native]
System.Windows.Forms.dll!System.Windows.Forms.Bind ingSource.OnCurrentChanged
System.Windows.Forms.dll!System.Windows.Forms.Bind ingSource.CurrencyManager_CurrentChanged
System.Windows.Forms.dll!System.Windows.Forms.Curr encyManager.OnCurrentChanged
System.Windows.Forms.dll!System.Windows.Forms.Curr encyManager.ChangeRecordState
System.Windows.Forms.dll!System.Windows.Forms.Curr encyManager.List_ListChanged
[Native to managed]
[Managed to native]
System.Windows.Forms.dll!System.Windows.Forms.Bind ingSource.OnListChanged
System.Windows.Forms.dll!System.Windows.Forms.Bind ingSource.InnerList_ListChanged
System.Data.dll!System.Data.DataView.OnListChanged
System.Data.dll!System.Data.DataView.IndexListChan ged
System.Data.dll!System.Data.DataViewListener.Index ListChanged
System.Data.dll!System.Data.Index.OnListChanged
System.Data.dll!System.Data.Index.RecordChanged
System.Data.dll!System.Data.DataTable.RecordChange d
System.Data.dll!System.Data.DataTable.SilentlySetV alue
System.Data.dll!System.Data.DataTable.EvaluateDepe ndentExpressions
System.Data.dll!System.Data.DataTable.EvaluateExpr essions
System.Data.dll!System.Data.DataTable.SetNewRecord Worker
System.Data.dll!System.Data.DataTable.InsertRow
System.Data.dll!System.Data.DataView.FinishAddNew
System.Data.dll!System.Data.DataRowView.EndEdit
System.Windows.Forms.dll!System.Windows.Forms.Curr encyManager.EndCurrentEdit
System.Windows.Forms.dll!System.Windows.Forms.Bind ingSource.EndEdit
Thank you very much in advance |