Hi,
So... what's your question?
Your MDI Parent would need to act as a pass through. What you are describing seems to be that you don't have any direct or indirect access to the sibling form, which is why you can only see it as a static because that does not require an instance.
You would need to do something like this:
On the MDIParent expose a method called RefreshGridOnFormType3() (or some other long and tedious name). The body of the method would look something like
public void RefreshGridOnFormType3()
{
// psudo code
foreach (Form f in this.MdiChildren)
if (f is Form3)
f.RefreshGrid() // need to cast this to a Form3 object
}
From your form 2, whenever you update a cell you would call the refresh method on the MdiParent
Form1 parentForm = (Form1) this.MdiParent;
parentForm.RefreshGridOnFormType3()
And form 3 would have a public method call RefreshGrid that would do whatever logic you want to do.
There are a few other variations on the theme, but that is the general idea.
MainForm foreach (Form frm in this.MdiChildren) { if (frm is frm_MF_Sales) { frm.Activate(); ((frm_MF_Sales)this.MdiParent).RefreshSalesGrid(); }
You are going through Form1's MDIChildren (so the forms opened by "this" which if I read this correctly is the MDIContainer), and then you are trying to cast the this.MDIParent (which if you are on the MDIContainer form, would be null) into your sales form
foreach (Form frm in this.MdiChildren) { if (frm is frm_MF_Sales) { frm.Activate(); ((frm_MF_Sales)frm).RefreshSalesGrid(); }