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
7/1/2024
MXN
535.29
2
Olivier
2/13/2025
EUR
751.21
3
Flavien
4/13/2025
BRL
857.21
4
Danail
10/7/2024
NZD
583.57
5
Alexandre
11/30/2024
USD
410.92
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
4/21/2025
CAD
870.87
2
Olivier
8/24/2024
AUD
249.09
3
Flavien
8/1/2024
HKD
704.67
4
Danail
8/15/2024
CAD
160.83
5
Alexandre
4/10/2025
CHF
752.55
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
5/27/2025
AUD
1,815.492
2
Olivier
12/13/2024
BRL
914.424
3
Flavien
10/3/2024
CHF
1,648.175
4
Danail
11/14/2024
EUR
343.928
5
Alexandre
3/21/2025
CHF
3,873.912