|
-
Sep 25th, 2003, 04:27 AM
#1
Thread Starter
New Member
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
-
Sep 25th, 2003, 06:07 AM
#2
Addicted Member
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
-
Sep 25th, 2003, 11:16 AM
#3
Thread Starter
New Member
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
-
Sep 25th, 2003, 11:25 AM
#4
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|