Hi,
I am writting a data navigator where if the user edits a form and tries to
move to a different record on the dataset without saving the current
record, he is prompted to save it before the BindingManagerBase position is
changed. I created a navigator class that includes a dirtyRow flag to
check when the user selects to move to a different record.
I am trying to keep track of changes by adding events to TextChanged on the
edit boxes of my form. If a textbox changes then the dirtyRow flag is set.
However I am encountering some problems since the TextChanged event is also
fired when text is changed due to the databinding for the control. I added
an event for PositionChanged on the BindingManagerBase that sets dirtyRow
to false and in general this works because when the position is changed,
the databinding sets the dirtyRow to true on the TextChanged event but the
PositionChanged event is called after the TextChanged event and therefore
the newly visited row is not considered dirty until the user changes the
text on the edit boxes. However this does not work the first time the form
is created because in that particular case, the TextChanged event from the
databinding is called AFTER the PositionChanged event.
My question...
1- Is there any way of knowing IF the EndCurrentEdit will actually modify
the underlying dataset? I noticed that RowState for a row changes to
Modified after EndCurrentEdit if there are changes. I want to prompt the
user to keep or save changes only if changes exist.
2- Is there an event that I can use to know that databinding for the form
on the current position has completed so I can set the dirtyRow flag to
false?
Thanks,
Jeronimo