Results 1 to 2 of 2

Thread: Auto show change in datagridview

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2017
    Posts
    1

    Auto show change in datagridview

    I have made one programma with two froms(form1,form2).Form1 has the datagridview and the Form2 i use it to pass the data to database(wich i saw them in datagridview). I want when i press tha save button in the form2 the same time saw the values in the datagridview at the form1 with out refresh butoon(like that is now). The programa is in c# abd i use mysql

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    Re: Auto show change in datagridview

    The grid is (hopefully) bound to a DataTable. If you expect what the user sees to change then you have to change that DataTable. Without knowing the specific details of your application, most likely Form1 should be passing that DataTable to Form2 so Form2 then makes the changes to that DataTable and then saves them from there to the database. That way, the changes actually show up in the grid before the database.

    The whole point of data-binding is that the state of the UI and the data source is bound, i.e. changes to one are reflected in the other. If you want the UI to change then you have to change the data source. It's that simple.

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