Hi
I have a TextBox and a DataGridView which is bound to a DataTable in a windows form application.
Some cells in the DataGridView are mandatory so when the user wants to leave a row, in RowValidating event handler the program checks if the current row is dirty and the mandatory cells do not have value,a message is shown and validation is canceled.
When I insert a row into the datagridview,click somewhere on the datagridview,return to the newly inserted row,change some values of the row(ex:empty mandatory cells) and then press Esc,changes are discarded and the old values are restored.But the problem is when I insert a row into the datagridview,click on the TextBox ,change some values of the row(ex:empty mandatory cells) and then press Esc,old values are not restored,and current row is not dirty,so the user leaves the row successfully without filling in the mandatory cells.
How should I fix this problem?
Thanks