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
11/30/2024
JPY
690.41
2
Olivier
6/21/2025
GBP
507.74
3
Flavien
5/29/2025
HKD
316.17
4
Danail
4/4/2025
USD
967.27
5
Alexandre
12/14/2024
CAD
545.1
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
6/8/2025
MXN
284.62
2
Olivier
11/22/2024
GBP
49.86
3
Flavien
4/25/2025
THB
97.77
4
Danail
11/23/2024
MXN
450.88
5
Alexandre
2/16/2025
JPY
527.48
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
4/20/2025
NZD
353.073
2
Olivier
1/9/2025
EUR
580.545
3
Flavien
1/22/2025
THB
297.024
4
Danail
9/11/2024
MXN
366.282
5
Alexandre
11/6/2024
AUD
4,044.726