Results 1 to 5 of 5

Thread: [RESOLVED] [2008] Updating DataGridView on KeyDown

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Manchester, England
    Posts
    255

    Resolved [RESOLVED] [2008] Updating DataGridView on KeyDown

    Hello all,
    I have a DataGridView that doesn't seem to update itself correctly.
    I have a column called, "Status" which is usually empty.
    When the user presses "E" (for erase), they are asked "Are you sure".
    Upon pressing Yes, a bound label on the form is updated to 'DELETED', which isn't being immediately shown in the DataGridView. I have to physically move up (or down) a row for 'DELETED' to be shown in the Status cell.
    I've tried .Refresh, but it doesn't make any difference.
    Any ideas?
    At home - VB.NET 2005/2008 Express, Visual Web Developer 2005 Express
    At work - VS 2008 Standard (VB)
    .NET 2.0/3.5


    Visual Studio Express Learning Centre | How do I videos | MSDN VB Express Forum | MSDN VB Developer Centre

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Updating DataGridView on KeyDown

    have you tried DataGridView1.Update()?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Manchester, England
    Posts
    255

    Re: [2008] Updating DataGridView on KeyDown

    No difference.
    At home - VB.NET 2005/2008 Express, Visual Web Developer 2005 Express
    At work - VS 2008 Standard (VB)
    .NET 2.0/3.5


    Visual Studio Express Learning Centre | How do I videos | MSDN VB Express Forum | MSDN VB Developer Centre

  4. #4
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2008] Updating DataGridView on KeyDown

    Can you show us the code please? Which control is being handled the KeyDown event?
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Manchester, England
    Posts
    255

    Re: [2008] Updating DataGridView on KeyDown

    Thanks for your reply.
    I've managed to fix it.
    The label is on a TabControl which is disabled whilst the DataGridView is enabled.
    I've had to enable to TabControl, write the text into the Label, and disable the TabControl again! Weird.
    At home - VB.NET 2005/2008 Express, Visual Web Developer 2005 Express
    At work - VS 2008 Standard (VB)
    .NET 2.0/3.5


    Visual Studio Express Learning Centre | How do I videos | MSDN VB Express Forum | MSDN VB Developer Centre

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