The Grid allows developers to choose whether the empty detail grids (which don't contain any rows) should be displayed or not.
To control this behavior, you need to use the MasterDetailSettings.ShowEmptyDetails property.

When using the OnLoad pattern, since all the detail grids are loaded at once when the page is loaded, setting the
MasterDetailSettings.ShowEmptyDetails property is enough for the Grid to determine which details to show and which to hide.

When using the OnCallback patter, since the detail grids are loaded on demand via AJAX, setting the
MasterDetailSettings.ShowEmptyDetails property is not enough for the Grid to determine which details to show and which to hide.
Developers also need to use the MasterDetailSettings.DetailsCountField property, to indicate the name of the field
from the data source which contains the number of details for each row. To populate this field, you can use a sub-query in the main query
that loads the data for the detail grid (check the source code of this sample).