# Expand only one detail row at a time

## Environment

<table>
    <tbody>
	    <tr>
	    	<td>Product Version</td>
	    	<td>8.1.1</td>
	    </tr>
	    <tr>
	    	<td>Product</td>
	    	<td>Progress® KendoReact Grid</td>
	    </tr>
    </tbody>
</table>

## Description

How can I expand only one detail row at a time?

## Solution

This can be achieved by setting the `expanded` field to `false` for all other rows when one row is expanded in the [`onExpandChage`](https://www.telerik.com/kendo-react-ui/components/grid/api/gridprops) event handler:

```jsx
const expandChange = (event) => {
    const updatedData = data.map((item) => ({
        ...item,
        expanded: item.ProductID === event.dataItem.ProductID ? !event.dataItem.expanded : false
    }));
    setData(updatedData);
};
```

The following example showcases this approach in action:

[Demo Source](https://demos.telerik.com/kendo-react-ui/knowledge-base/grid/grid-expand-one-detail-row/source.txt)
