Update the grid changes from other form
hallo, i am having two forms the first form has grid and other form add new record and update,i want to update the the grid on the main form with changes from other form
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Sukesh MarlaRank #461 · 5.4K reputationPosted Sep 16, 2012, 7:39 AM EDT
public DataTable dtCustomers
{
get
{
return (DataTable)datagridview1.datasource;
}
set
{
datagridview1.datasource=value;
}
}
.
.
.
.
in secondayfrom create a property like this
public MainFrom m
{get;set;}
in Main form when u open seconday from
SecondayFrom f=new SecondayrForm();
f.m=this;
f.show();
Now in seconday from you can access main form..
Simply make changes to m. dtCustomers after save in secondayfrom, it will refresh the grid automatically.
Check this is correct answer if it helped,