dk96m
dk96m

Reputation: 331

Bindingsource row state changing without modifications

I have a form with bound controls and a binding navigator. I have an event when the user clicks next or previous on the binding navigator to check to see if there is a change, if there is, it asks if they want to save their changes. The problem i am having is that if sometimes, on certain records it is saving that the row has been modified thus asking if they want to save. The problem is nothing has been modified. How do i see what was modified while debugging to try and address why the row state is changing

Below is part of the code i use to do the check:

Private Sub BindingNavigatorMoveNextItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorMoveFirstItem.Click, BindingNavigatorMoveLastItem.Click, BindingNavigatorMoveNextItem.Click, BindingNavigatorMovePreviousItem.Click
    Try
        FkTSTAFFSKILLSBindingSource.EndEdit()
        TSTAFFAVAILPERSBindingSource.EndEdit()

        Dim staffdrv As DataRowView = CType(Me.TSTAFFAVAILPERSBindingSource.Current, DataRowView)
        Dim skilldrv As DataRowView = CType(Me.FkTSTAFFSKILLSBindingSource.Current, DataRowView)
        If staffdrv.Row.RowState = DataRowState.Modified Or skilldrv.Row.RowState <> DataRowState.Unchanged Then

It is staffdrv.Row.RowState = DataRowState.Modified that is showing true. Now it doesnt happen every time, only on certain records.

Please help, I have been banging my head against the wall for over a week trying to figure this out.

Upvotes: 0

Views: 366

Answers (0)

Related Questions