Data Grid - Row customization recipes
Advanced row customization recipes.
One expanded detail panel at a time
By default, the Master-detail row panel 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
4/4/2025
NZD
915.48
2
Olivier
9/1/2024
EUR
258.44
3
Flavien
7/17/2024
MXN
487.44
4
Danail
11/18/2024
NZD
76.13
5
Alexandre
4/25/2025
USD
716.05
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/19/2024
USD
912.5
2
Olivier
6/10/2025
EUR
612.74
3
Flavien
7/16/2024
NZD
46.8
4
Danail
3/4/2025
JPY
110.81
5
Alexandre
5/20/2025
NZD
138.56
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
9/15/2024
MXN
681.324
2
Olivier
11/11/2024
THB
1,003.506
3
Flavien
12/6/2024
BRL
987.494
4
Danail
5/25/2025
ARS
1,022.826
5
Alexandre
4/5/2025
TRY
2,932.398