My Application is MDI. I have grids on all of my child forms.
One of my child form (lets call in "total") contains a grid that is a summation of all of the other grids on the other child forms. When I change a value on one of the grids on the child forms I need the datasource of the "total" form to be updated. How can I do this?
I have a method on that "total" child form that fetches the new datatable to update its grid. How do I call it from other child forms? Also, is this the best way to do it?
Should I call a method on the parent form that executes the method on the "total" form?
method on total form
One of my child form (lets call in "total") contains a grid that is a summation of all of the other grids on the other child forms. When I change a value on one of the grids on the child forms I need the datasource of the "total" form to be updated. How can I do this?
I have a method on that "total" child form that fetches the new datatable to update its grid. How do I call it from other child forms? Also, is this the best way to do it?
Should I call a method on the parent form that executes the method on the "total" form?
method on total form
Code:
public void RefreshSales()
{
DataTable dtUpdated = new DataAccess().GetDataForGrid(IftProperties.IFTNo, IftProperties.Version, "Sales_Pivot");
UltraGrid ugrid = this.ultraGridSales;
//Merge changes
salesDataTable.Merge(dtUpdated, false);
// Refresh grid, this does not redraw grid
dtUpdated.Dispose();
}