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
1/28/2025
USD
17.37
2
Olivier
4/29/2025
HKD
784.97
3
Flavien
7/29/2024
AUD
884.58
4
Danail
11/25/2024
HKD
75.64
5
Alexandre
9/5/2024
AUD
265.84
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
5/23/2025
EUR
256.37
2
Olivier
3/7/2025
BRL
872.87
3
Flavien
8/6/2024
THB
185.61
4
Danail
5/2/2025
USD
342.7
5
Alexandre
8/18/2024
HKD
186.68
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/15/2025
CHF
1,731.933
2
Olivier
1/31/2025
BRL
3,007.305
3
Flavien
8/2/2024
JPY
969.927
4
Danail
11/15/2024
HKD
2,659.955
5
Alexandre
1/8/2025
CAD
2,074.013