Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using C# Windows For Application in .Net 2.0 and Visual Studio 2005. I have 2 forms.

1. MDI form which has the datagridview.
2. Windows form used for entering the values.

There are 2 buttons on windows data entry form Their functionalities:
1. 'Enter' button: when clicked the data should be saved in the database. the data entry form should disappear. the datagridview on MDI form must be updated with the new entry.

2. 'Enter Another' button: when clicked the data should be saved in the database. the datagridview on MDI form must be updated with the new entry. the data entry form should be ready for another entry.

When i clicked on 'Enter Another' button, the datagridview on MDI form does not show updated data row unless I manually restart the form.

Another thing is that the implementation logic is clear to me but I am unable to convert it into C# code.
What could be solution?

Thanks in advance....
Posted

1 solution

I think that you should share the same datasource object between your two forms. It is possible to bind the same data on more than one control.

If a dataGridView is binded to a datasource object and you manualy update data into the object, then the gridView will update it's content automatically.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900