How do i identify changes made in the datagridview while closing a form containing DGV? If the changes have been made then it must ask me to save or discard changes.
Printable View
How do i identify changes made in the datagridview while closing a form containing DGV? If the changes have been made then it must ask me to save or discard changes.
Is the grid bound? Is it bound to a DataTable. If so the table's GetChanges method will tell you. It will return Nothing if no changes have been made. If the grid is not bound or it's not bound to a DataTable then it's up to you to handle the appropriate event(s) to be notified when a change is made to the data and set a flag. You can then test the flag when you're closing the form.
Thank You.