CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2009
    Posts
    144

    Datagridview refresh contents

    hello, i have a datagridview and i add edit and delete it's values... and after every change i do
    Code:
     this.myTableAdapter.Fill(this.myDataSet.my);
    this updates my datagrid successfully but if i had a row selected before update in the datagridview after the update no row is selected... but i don't want to lose my selection..

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Datagridview refresh contents

    Save the selected row (or index) before filling it and then set it again afterward.

  3. #3
    Join Date
    Jun 2009
    Posts
    144

    Re: Datagridview refresh contents

    i thought about it but it doesn't help me... because i want to scroll up and down and if the update occurs during my scroll i will go to the top....

  4. #4
    Join Date
    Jul 2003
    Location
    Bali, Indonesia
    Posts
    103

    Re: Datagridview refresh contents

    Don't fill the the tableadapter after every update, Just acceptchanges the dataset.

  5. #5
    Join Date
    Jun 2009
    Posts
    144

    Re: Datagridview refresh contents

    didn't work....

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