C# Programming
04-06-2009, 08:00 PM
Can't believe there is not a quick obvious solution to this, I must be missing something.
I have a winforms app with a tabbed control with textbox controls bound to a dataset table. If the user attempts to leave the tab I want to check for open edits and throw up a save/cancel dialog box if there are.
The problem arises when I need to test for row edit mode.
This:
if (DS.Tables["table_name"].Rows[0].RowState == DataRowState.Modified)
{....}
doesn't reflect any edits until I call endedit on the row, but then the edit is committed and now the user can't go back and cancel the edits.
Is there a way to check edit status on a dataset table row without calling endedit?
I have a winforms app with a tabbed control with textbox controls bound to a dataset table. If the user attempts to leave the tab I want to check for open edits and throw up a save/cancel dialog box if there are.
The problem arises when I need to test for row edit mode.
This:
if (DS.Tables["table_name"].Rows[0].RowState == DataRowState.Modified)
{....}
doesn't reflect any edits until I call endedit on the row, but then the edit is committed and now the user can't go back and cancel the edits.
Is there a way to check edit status on a dataset table row without calling endedit?