DataGrid Change Check

Dec 13 2005 7:15 PM
Hello, I have a little problem and I will be very grateful if you can help me. Here it is: I have a form with a DataGrid and "Save" and "Exit" button. I have filled the DataGrid with data from MS Sql Server Table. I fill it on the Load event of the Form. How can I make that when you press the exit button, if something in the DataGrid is changed to ask the user if he want to save the data back to the SQL Table. I have tried to do it with a little bool variable - "isChanged" to which I pass value "false" at the Load event and in a Form OnChange event I pass to it "true" and on the press event of the exit button I check if the value is "true" or "false". But the OnChange event triggers even if the user only click somewhere in the DataGrid without changing any data. Please tell me how to fix this annoying problem ?

Answers (1)