-
Help in VB's Datagrid
Is it possible to discard all the changes made in Datagrid. I placed a datagrid in my form and set the datagrid's allow update to true. When the user closes the form i placed a message box prompting to save or discard the changes made in the datagrid. I tried doing the cancel update, but only the last edited row data was discarded, the remaining were updated. Please help me. Thanks
-
Hi.
what kind of data you had bounding to your grid? when you load ado recordset you can say adLockBatchOptimistic which ask for .UpdateBatch whenever you need to update so what you can do is just put this rs.updatebatch whenever user says NO, if you're not bounding data and you're using dbgrid you have to make a backup of data inside grid into an array and load it back if your user dont' want to save changes
Hope it helps.
S. Mohammad Najafi
-
Hi
Many Thanks to you vbCodec(S. Mohammad Najafi), you really helped me a lot. I used the updatebatch = adaffectallchapters and it worked.
By the way am i right about the adaffectallchapters. Whats the difference with adaffectallchapters, adaffectcurrent and adaffectGroup?
Thanks to you again man,
Roy V. Astronomia
-
actually I never need to use that but I think that is more focusing on if you had applied filter to your recordset and you just want to update those record who is visibile or you want to apply it to invisibiles and etc...
Hope it helps.
S. Mohammad Najafi