T
Tomasz J
Hello Developers,
What I am trying to accomplish may seem trivial: simple data entry form with
DataRowView, BindingNavigator and several bound TextBoxes, DataRowView in
read-only mode.
When the user modifies data through one of the TextBoxes and then attempts
to change the current record he should be asked whether he wants to save
changes, cancel changes or abort.
And here is the problem: I found easy, consistent way of aborting the
attempt to move to another record. Technically speaking, I need a way to
cancel BindingSource.PositionChanged event, regardless of the original event
source, that is, regardless of whether user tries to reposition using
BindingNavigator or DataRowView.
Setting BindingSource.Position to the previous value inside the
BindingSource.PositionChanged event handler partially works - but only when
position is changed using BindingNavigator. When DataRowView is used, row
selected in DataRowView still changes, and selection no longer matches
BindingSource.Position, as well as row number displayed in BindingNavigator.
I also must be able to cancel PositionChanged in case user chooses to save,
but this operation fails.
Please advise. There must be some common way of implementing such typical
scenario.
Thank you.
Tomasz J
What I am trying to accomplish may seem trivial: simple data entry form with
DataRowView, BindingNavigator and several bound TextBoxes, DataRowView in
read-only mode.
When the user modifies data through one of the TextBoxes and then attempts
to change the current record he should be asked whether he wants to save
changes, cancel changes or abort.
And here is the problem: I found easy, consistent way of aborting the
attempt to move to another record. Technically speaking, I need a way to
cancel BindingSource.PositionChanged event, regardless of the original event
source, that is, regardless of whether user tries to reposition using
BindingNavigator or DataRowView.
Setting BindingSource.Position to the previous value inside the
BindingSource.PositionChanged event handler partially works - but only when
position is changed using BindingNavigator. When DataRowView is used, row
selected in DataRowView still changes, and selection no longer matches
BindingSource.Position, as well as row number displayed in BindingNavigator.
I also must be able to cancel PositionChanged in case user chooses to save,
but this operation fails.
Please advise. There must be some common way of implementing such typical
scenario.
Thank you.
Tomasz J