J
jay.meerdink
Greetings!
I have a simple Windows form for editing. Search results are bound to
a bindingsource and shown in a datagrid paired with a datanavigator.
The current row's data is displayed in text boxes bound to the same
bindingsource. I'd like to present a save / cancel dialog if the user
changes the current data and attempts to navigate away from the current
record. There's a ColumnChangingEvent on the underlying data object.
I check if (e.ProposedValue.ToString() !=
e.Row[e.Column.ColumnName].ToString()) to detect dirty, but I can't
find a cancelable event that fires when navigation is about to happen.
Could check dirty on the navigator buttons, but that wouldn't prevent
the user from just clicking on another row in the datagridview. I see
events like datagridview.rowleave but I'd have to detect dirty and this
event isn't cancelable. Bindingsource.currentchanged fires after the
pointer has landed on a new row and doesn't look like it's cancelable
anyway.
I know I must be missing something obvious. Help!
TIA,
Jay
I have a simple Windows form for editing. Search results are bound to
a bindingsource and shown in a datagrid paired with a datanavigator.
The current row's data is displayed in text boxes bound to the same
bindingsource. I'd like to present a save / cancel dialog if the user
changes the current data and attempts to navigate away from the current
record. There's a ColumnChangingEvent on the underlying data object.
I check if (e.ProposedValue.ToString() !=
e.Row[e.Column.ColumnName].ToString()) to detect dirty, but I can't
find a cancelable event that fires when navigation is about to happen.
Could check dirty on the navigator buttons, but that wouldn't prevent
the user from just clicking on another row in the datagridview. I see
events like datagridview.rowleave but I'd have to detect dirty and this
event isn't cancelable. Bindingsource.currentchanged fires after the
pointer has landed on a new row and doesn't look like it's cancelable
anyway.
I know I must be missing something obvious. Help!
TIA,
Jay