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
6/5/2025
CAD
341.66
2
Olivier
9/24/2024
HKD
6.29
3
Flavien
2/23/2025
ARS
709.96
4
Danail
3/8/2025
THB
261.88
5
Alexandre
12/25/2024
TRY
128.11
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
2/16/2025
JPY
480.02
2
Olivier
11/25/2024
CHF
346.1
3
Flavien
6/3/2025
CAD
732.36
4
Danail
9/6/2024
GBP
456.67
5
Alexandre
6/27/2024
GBP
527.82
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
8/30/2024
USD
700.287
2
Olivier
8/10/2024
MXN
960.435
3
Flavien
10/26/2024
AUD
1,088.168
4
Danail
6/15/2025
TRY
1,097.303
5
Alexandre
8/10/2024
NZD
1,014.353