Pass value from MDIChild form to MDIParent form

  • Thread starter Thread starter zul hayat
  • Start date Start date
Z

zul hayat

Guest
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())

{

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 gives error 'object reference not set to an instance of an object'

Please Help...

Continue reading...
 
Back
Top