C # Clear Datagridview on parent form when child form is closed

I have an MDI application with a Datagridview control in its parent (main) form. Clicking on an item in the toolbar menu fills the datagrid and opens the corresponding child form.

On closing the child form, I want to clear the datagrid in the parent form.

Many thanks!

+1


source to share


2 answers


When opening a new child form, pin its form close, or raise a closed event and clear the datagridview content at that point in the main form.



+1


source


Listen for the .Closed event on the child form. In the handler, clear the datagrid.



You might want to read Building Basic MDI Applications in C # .

0


source







All Articles