CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    192

    Create a History table

    Hi,

    I have a datagridview (DgvPracExcl) which at runtime allows a user to update the records to a table in the database.

    Now, I want to save a history prior to the update. Therefore, create a history table..

    Any ideas...

    Thanks

  2. #2
    Join Date
    Sep 2012
    Posts
    6

    Re: Create a History table

    my first idea is create handle keydown on datagridview.
    on first keydown event store old value in memory , on enter/end edition compare with actual value, if different then log in your history...
    This way you can log all rows or selected cells

    Am I right?

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Create a History table

    as long as the event was ONE KEYSTROKE only. not practical
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Sep 2012
    Posts
    6

    Re: Create a History table

    why? any clue?

    then mayby cell.enter and cell.leave?

    as I see, you have got solution.

    benek

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Create a History table

    Trap the ENTER key, the ARROW KEYS, and most importantly handle the BACKSPACE correctly. There are many samples. Cell Enter and Leave might or might not process the data before leaving
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Sep 2012
    Posts
    6

    Re: Create a History table

    then maybe cellchanged?
    previous values are still in datatable, so u can compare these and logs
    Last edited by benuto; September 7th, 2012 at 04:49 PM.

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

Featured