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
11/13/2024
GBP
100.48
2
Olivier
1/19/2025
THB
364.17
3
Flavien
11/1/2024
AUD
31.98
4
Danail
10/25/2024
TRY
757.48
5
Alexandre
2/21/2025
THB
107.75
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
9/4/2024
NZD
133.13
2
Olivier
4/2/2025
CAD
39.3
3
Flavien
7/15/2024
TRY
553.98
4
Danail
11/13/2024
HKD
387
5
Alexandre
11/15/2024
CHF
523.62
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
1/27/2025
THB
2,215.374
2
Olivier
4/20/2025
JPY
2,757.3
3
Flavien
11/27/2024
TRY
814.317
4
Danail
12/31/2024
NZD
882.378
5
Alexandre
5/23/2025
CHF
1,701.672