Beginner question, help!

P

Pablo Czyscas

Hi, i´m new developping app, and my question is:

I´ve 2 forms, fomr1 anf form2. In my form1 i´ve a datagrid that show some
data products from a SQLCE db... the form2 has a textbox where the user fill
a product name... how can i accomplish when the form2 is show, the user
enter into the textbox a product name, and when he press ok and the form2 is
closed, the form1 show the new data ?

Thanks a lot!
 
A

Armando Rocha

Hi,

You can do that in form1_Activated, when you close form2, you can refresh
datagrid on form1 activated.

hope this help.
 
J

Jin Chang

Hi, i´m new developping app, and my question is:

I´ve 2 forms, fomr1 anf form2. In my form1 i´ve a datagrid that show some
data products from a SQLCE db... the form2 has a textbox where the user fill
a product name... how can i accomplish when the form2 is show, the user
enter into the textbox a product name, and when he press ok and the form2 is
closed, the form1 show the new data ?

Thanks a lot!

I assume that you're opening the edit form using ShowDialog. If so,
set the this.DialogResult to an appropriate DialogResult enum value
(i.e. DialogResult.OK) before closing. From the caller, you can
retrieve the return value which should be the value you have just set
and take appropriate actions, such as rebinding your datagrid to show
the changes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top