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
2/28/2025
TRY
66.22
2
Olivier
1/16/2025
NZD
107.23
3
Flavien
12/7/2024
THB
117.76
4
Danail
11/22/2024
ARS
130.73
5
Alexandre
1/28/2025
BRL
450.12
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/5/2024
AUD
563.6
2
Olivier
7/17/2024
ARS
437.01
3
Flavien
9/10/2024
EUR
499.16
4
Danail
4/29/2025
JPY
762.47
5
Alexandre
2/13/2025
BRL
53.51