1

I want to pass value from mdi child form to mdi parent form without refreshing the mdi parent form. when I open the child form from mdi parent form the code is here.

Product_Defination product_Defination = new Product_Defination("", "");
                using (FetchProductsDetail fetchProductsDetail = new FetchProductsDetail("ProductDefine","",_userconfig))
                {
                    fetchProductsDetail.MdiParent =  product_Defination.ParentForm;
                    fetchProductsDetail.ShowDialog(this);
                }

And now the code for fetching data from child form to parent form is given below:

         Product_id = dataGridView1.CurrentRow.Cells[0].Value.ToString();
Product_Defination prod_define = (Product_Defination)this.ParentForm;                
prod_define.get_productid_notifyme(Product_id);

Above code is giving error 'object reference not set to an instance of an object' Rememver that i have also used this.Owner instead of this.ParentForm Kindly Help.

Zuli
  • 11
  • 1
  • 3
  • If you need a reference to mdi parent form in an MDI childern, `MdiParent` property gives you the parent form. – Reza Aghaei Mar 07 '19 at 06:43
  • Thanks for your reply. But my concern is about my code. After searching all possibilities, I put my query here. – Zuli Mar 07 '19 at 07:30

0 Answers0