tags:

views:

82

answers:

1

hello to all

here is my question

i have a win app withe two forms

-form1 shows a datagridciew which shows tha data of a tabvle -Form2 has some textboxes and a save buttton that save the data in the table (insert, update)

so,i want when i click tha save button of form2 ,the datagrid of form1 to be refreshed with the the new datas

the form1 must me open all the time, not close when the form2 appears

A: 

To open a form without closing another and forcing the user's focus on the newly opened form, us the Form.ShowDialog() method.

If you bound the DataGridView to a data source, you can update it (using DataGridView.Update()) in one of several methods, including Form.GotFocus().

This is a bit of a hacked solution, but it should do what you need it to do.

Matthew Jones