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/23/2024
CHF
154.45
2
Olivier
10/15/2024
CAD
45.66
3
Flavien
6/28/2025
JPY
294.49
4
Danail
4/25/2025
MXN
841.16
5
Alexandre
3/21/2025
HKD
651.06
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
7/11/2025
THB
948.49
2
Olivier
5/16/2025
NZD
128.74
3
Flavien
8/4/2024
CAD
376.34
4
Danail
8/6/2024
TRY
61.48
5
Alexandre
8/20/2024
GBP
46.38
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
11/1/2024
GBP
905.352
2
Olivier
6/10/2025
CAD
100.328
3
Flavien
10/27/2024
THB
4,386.323
4
Danail
8/26/2024
CHF
423.066
5
Alexandre
7/20/2025
THB
3,223.92