Grid load order

I’ve an application with two grids master/detail.
Master grid is added to the layout before detail one.
When data are loaded from the data provider, however, it loads before detail data than master producing an unwanted result.
How can I solve that issue ?
Tks

Nobody can help ?
Tks

Hi,

In general, you should load the data of the detail grid when you select or click on a row of the grid.

I think the problem is related to your implementation so perhaps you can add more details.

Tks for Your help but the problem happens before I click or select anything.
When I show my two grids they appear full of data but, behind scenes, I can see the query of the detail grid staring before the master one and then the query of the detail is wrong because the master was non selected.
Tks

How are you filling the detail grid?

Quite difficult question.
I set, for both grids, a dataprovider.
The detail data provider knows the current row in the master and build the query in the appropriate way.
Debugging the application the stack trace of the operations calling the data provider doesn’t contain any code written by me and seems to be originated from the client (UIDL…).
Tks

You should probably set the data provider of the detail grid on the selection listener of the master grid.
masterGrid.addSelectionListener( ...)

detailGrid.setDataProvider() will query your database.