Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
As i am new to windows Applications i want to know how to refresh an gridview. I Have an MDI parent (AdminPanel) and it has two child Form.

1-EditEmp 2-ShowEmp

There is an DataGridview on ShowEmp.cs and when i click on an edit button in the gridview it opens EditEmp.cs with the values.. When i click on the update button Record in the database is updated and the EditEmp form got closed but datagridview on ShowEmp shows the earlier values.. It is refresed only when i close that form and again opens it..

I want to know how to refersh that gridview when the form EditEmp got closed..without closing the form that contains the gridview..
Posted

Sergey Alexandrovich Kryuokov wrote:

Here is the best way of using MDI child: never using MDI. Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?[^]

I agree with Him in 100%.

On the other hand, you're talking about passing data between forms[^].

Follow the links provided to find out the solution.
 
Share this answer
 
C#
EditEmp e = new EditEmp();
e.ShowDialog();
BindGrid();
 
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