Updating multiple grids based on another grid's selection

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


Attachment: Forecast_Main_feed2a7e.zip

2 Replies

RC Roger Criebaum December 10, 2020 08:36 PM UTC

I should also point out that the lock up happens randomly. There doesn't seem to be a set number of record selections--it can happen on the 3rd selection or the 30th.


MA Mohanram Anbukkarasu Syncfusion Team December 11, 2020 12:08 PM UTC

Hi Kevin, 

Thanks for contacting Syncfusion support. We are able to understand the scenario. However we are unable to reproduce the issue in our end only with the provided details as you have mentioned it is occurring randomly. If possible please share a simple sample issue reproducible sample. Otherwise please share the below mentioned details.  

  1. Number of records in each SfDataGrid.
  2. Code snippets related to SfDataGrids in your application to know all the properties values provided for the SfDataGrids.
  3. Any other customizations in your application related to SfDataGrid.

Based on these details we will try to reproduce the reported issue in our end. It will be helpful for us to find the exact cause for the issue and to provide a prompt solution.  

Regards, 
Mohanram A. 


Loader.
Up arrow icon