Data Grid - Row customization recipes
Advanced row customization recipes.
One expanded detail panel at a time
By default, the Master detail feature supports multiple expanded detail panels simultaneously.
However, you can control the expanded detail panels to have only one detail panel expanded at a time.
Order ID
Customer
Placed at
Currency
Total
1
Matheus
12/18/2024
MXN
786.59
2
Olivier
5/22/2025
AUD
530.87
3
Flavien
11/2/2024
AUD
276.72
4
Danail
7/1/2024
NZD
319.97
5
Alexandre
7/9/2024
CAD
448.37
Expand or collapse all detail panels
The following demo shows how to create a custom header element that expands or collapses all detail panels at once.
Here's how it works:
The custom header uses gridRowsLookupSelector
to find all rows with a detail panel.
It checks the status of open panels using the useGridSelector
hook to access the grid's state.
When clicked, it uses setExpandedDetailPanels
from the Grid API to expand or collapse all detail panels.
Order ID
Customer
Placed at
Currency
Total
1
Matheus
10/10/2024
MXN
157.72
2
Olivier
4/1/2025
JPY
394.12
3
Flavien
5/5/2025
AUD
148.15
4
Danail
12/3/2024
USD
75.81
5
Alexandre
6/29/2024
CHF
543.24
Toggling detail panels on row click
In the demo below, you can toggle the detail panel by clicking anywhere on the row:
Order ID
Customer
Placed at
Currency
Total
1
Matheus
12/29/2024
USD
520.832
2
Olivier
10/16/2024
CHF
1,656.743
3
Flavien
1/16/2025
USD
2,298.398
4
Danail
4/8/2025
ARS
4,716.81
5
Alexandre
12/20/2024
MXN
2,800.854