The DevExpress Blazor Grid component allows you to create hierarchical layouts of any complexity and depth. This example demonstrates how to use a nested grid component to visualize a master-detail relationship between two data tables.
Follow the steps below to add a detail grid to implement a nested layout:
-
Add a master Grid to a page. Bind the Grid to data and populate it with columns.
-
Place a detail Grid in a separate component. Bind this Grid to data and populate it with columns.
-
Add DetailRowTemplate to the master Grid's markup. In the template, declare a component that displays the detail Grid. Use the template's context object to filter the detail Grid's data.
-
Set the master Grid's AutoCollapseDetailRow property to
true
to collapse the expanded detail row once a user expands another detail row.