dcsimg
Results 1 to 3 of 3

Thread: [RESOLVED] Refresh form 1 from form 2

  1. #1

    Thread Starter
    Fanatic Member schoemr's Avatar
    Join Date
    Apr 2016
    Location
    South Africa
    Posts
    970

    Resolved [RESOLVED] Refresh form 1 from form 2

    Hi,

    I have try to do some research on this, but I am not finding exactly what my scenario is... For me 'refresh' means something different I think for English speaking people.

    I have form 1 that is have a datagridview (bound, and using tableAdapter and Bindingsource).

    So a user select a record in the datagridview and form 2 is open with the "details" (textboxes and labels) of that row (I get the ID from that selected row and do a FillBy based on that ID when form 2 is load. Also I open form to in Dialogue.

    So now the user can edit this record and press save button. (all this is working well)

    But now..... Once form2 is close then form1 is still show details of before save.... I have to close that form1 and open again to see the change.

    I can do a fillyBy from form2 to "re-load" form1 but then..... When form2 close, form1 will now have top row selected... and now I have to find that row again...

    I guess I could get the row before open form2 and get back to that row after close... But I was hoping maybe there is a more elegant way of doing this?

    Is it possible to refresh/update/reflect that change in form1 without re-loading everything?

    Thanks
    Don't miss the whole point of the dance...

    https://www.youtube.com/watch?v=qHnIJeE3LAI

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    102,389

    Re: Refresh form 1 from form 2

    Quote Originally Posted by schoemr View Post
    I guess I could get the row before open form2 and get back to that row after close... But I was hoping maybe there is a more elegant way of doing this?
    That is the elegant way. Why would you consider going back to the database to get data that you already have to be more elegant than using the data you already have? A form is an object like any other and dialogues are often used to gather data to be used in the calling form. That's what they're for. The idea that there's something inelegant about that seems very strange.

  3. #3

    Thread Starter
    Fanatic Member schoemr's Avatar
    Join Date
    Apr 2016
    Location
    South Africa
    Posts
    970

    Re: Refresh form 1 from form 2

    Oh okay, thanks John...
    Don't miss the whole point of the dance...

    https://www.youtube.com/watch?v=qHnIJeE3LAI

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width