Results 1 to 4 of 4

Thread: Help in VB's Datagrid

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    12

    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

  2. #2
    Addicted Member
    Join Date
    Sep 2003
    Posts
    160
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    12

    Thumbs up

    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

  4. #4
    Addicted Member
    Join Date
    Sep 2003
    Posts
    160
    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
  •  



Click Here to Expand Forum to Full Width