# Row Drag & Drop

The Grid supports row reordering so users can move records to a new position within the same Grid or between Grid instances. Choose click-move-click or drag and drop to match your workflow.

## Row Click-Move-Click

As of Kendo UI R2 SP1 2023, users can reorder the Grid's rows by using the click-move-click functionality provided by the [clickMoveClick](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/grid/configuration/reorderable/rows#reorderablerowsclickmoveclick) option. To start moving the row, users can click the drag icon, and then click again to place the row in its new position.

```dojo
    <div id="grid"></div>
    <script>
        $("#grid").kendoGrid({
            columns: [
                { draggable: true, width: "40px" },
                { field: "name" },
                { field: "age" }
            ],
            dataSource: [
                { id:1, name: "Jane Doe", age: 30 },
                { id:2, name: "John Doe", age: 33 }
            ],
            reorderable: {
                rows: {
                    clickMoveClick: true
                }
            }
        });
    </script>
```

## Row Drag and Drop

The Drag and Drop functionality for the Grid rows allows you to move a single row or multitude rows between different parents in the same Grid or between different Kendo UI Grid instances.

For a runnable example, refer to the [demo on Row Drag & Drop in the Grid](https://demos.telerik.com/kendo-ui/grid/drag-drop).

### Getting Started

To enable the Drag and Drop functionality, set the `reorderable.rows` property to `true`.

> * The Drag & Drop functionality requires defining the `id` field of the data items in [`schema.model`](https://www.telerik.com/kendo-jquery-ui/documentation/api/data/datasource/configuration/schema#schemamodel). This ensures the correct reordering of the data items.

```js
$("#grid").kendoGrid({
    dataSource: {
        data: [
            { ProductID: 1, ProductName: "Chai" },
            { ProductID: 2, ProductName: "Chang" }
        ],
        schema: {
            model: {
                id: "ProductID"
            }
        }
    },
    columns: ["ProductID", "ProductName"],
    reorderable: {
        rows: true
    }
});
```

### Drag handle

You can render a drag handle and the user could reorder the rows by dragging the row through its drag handle. To enable the drag handle, add the `draggable: true` property in the columns configuration.

```js
$("#grid").kendoGrid({
    columns: [
        { draggable: true },
        { field: "ProductName", title: "Product Name", width: "200px" },
    ],
    // Other configuration.
 });
```

### RowReorder Event

The [`rowReorder`](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/grid/events/rowReorder) event fires when the user drops a row into a new location. It allows you to manipulate your data collection based on where the user dropped the element.

```js
$("#grid").kendoGrid({
    dataSource: {
        schema: {
            model: {
                id: "ProductID"
                }
            }
    }
    reorderable: {
        rows: true
    },
    rowReorder(ev) {
        // TODO: update your data collection using ev.oldIndex and ev.newIndex.
    }
    // Other configuration.
 });
```

### Keyboard Navigation

The Grid supports its keyboard navigation functionality through the `navigatable` option.  Once enabled, the user will be able to reorder rows by using the following key combination:

`Ctrl` + `Up Arrow / Down Arrow`

When [`multiple selection`](https://www.telerik.com/kendo-jquery-ui/documentation/controls/grid/selection#multi-row-selection) is enabled for the Grid rows the user can drag and drop the selected rows with the following combination:

`Ctrl` + `Mouse left-click`

> tip As of Kendo UI version R3 2023, the Row Drag and Drop on mobile devices activates on `hold` & `slide` of the row.

### Known Limitations

* Row Drag & Drop is not supported when [`sorting`](https://www.telerik.com/kendo-jquery-ui/documentation/controls/grid/sorting) is applied — The sort re-orders the data after every change, so a dropped row immediately returns to its sorted position instead of staying where it was placed.
* Row Drag & Drop is not supported when [`filtering`](https://www.telerik.com/kendo-jquery-ui/documentation/controls/grid/filtering) is applied — Because the filter hides rows from the view, the drop position does not match the actual position in the full dataset, causing rows to land in the wrong place.
* Row Drag & Drop is not supported when [`grouping`](https://www.telerik.com/kendo-jquery-ui/documentation/controls/grid/grouping/overview) is applied — Rows can only be dropped within the flat list of visible data rows, so reordering across groups is not possible.

## See Also

* [Drag & Drop in the KendoUI Grid (Demo)](https://demos.telerik.com/kendo-ui/grid/drag-drop)
* [JavaScript API Reference of the KendoUI Grid](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/grid)
