Hi,
I have a MDI form containing multiple child windows, each of which contains a SfDataGrid. There is a "main" window where the user selects a record. When the record is selected, the app will go through each of the other windows' grids and set the DataSource according to the selected record. See the image in the attached zip file.
When I have only the Vendor Items and Inventory windows displayed, I can click on any item in Vendor Items and the Inventory grid will update with no issues. However, if I have either History or Inventory Commitment window open, the app will randomly lock up. I've redesigned my code to ensure that events are not wired more than once and that grid columns are not created more than once. The process for updating each grid is rather procedural: call a "load" method for each grid one at a time. The assumption is that each window's grid is loaded completely before moving to the next one.
One thing I did notice...when the app locks up, the busy indicator is visible on all of the grids, not just the one being updated. For example, the Commitment grid is loaded last and has a busy indicator; the Inventory and History grids also have busy indicators. I would assume that once the grid is populated, the indicator goes away and the "load" method returns. Is this not the case? I've also added a DataSourceChanged event for each grid. Only when all of the "load" methods have returned does the DataSourceChanged event fire (see log snippet below). Would this have anything to do with the app locking up?
Log Snippet:
ItemsDataGrid_SelectionChanged: start
LoadCurrentItem: WIN1022
LoadInventory: start (item = WIN1022)
CreateInventoryForm: start
FindOpenForm(InventoryForm) => found
CreateInventoryForm: done
ItemNeeds
exec sky_ForecastItemDetails '100', 4, 'WIN1022', False, True, False
ItemNeeds: 4 records
LoadInventory: done
LoadHistory: start (item = WIN1022)
FindOpenForm(HistoryForm) => found
ItemHistory
ItemHistory: 14 records
LoadHistory: done
LoadInventoryCommitment: start (item = WIN1022)
FindOpenForm(CommitmentForm) => found
InventoryCommitment
ItemCommitment: 0 records
LoadInventoryCommitment: done
LoadRecentSales: start (item = WIN1022)
FindOpenForm(RecentSalesForm) => not found
LoadRecentSales: done
LoadCurrentItem: done
ItemsDataGrid_SelectionChanged: done
InventoryGrid_DataSourceChanged
HistoryGrid_DataSourceChanged
CommitmentGrid_DataSourceChanged
My question: is there are "standard practice" for updating multiple grids in an application, especially grids contained in child windows rather than in the same window?
I will continue to work on a solution to this problem. Thanks in advance for your assistance.
Kevin