# In-Cell Editing

The Gantt provides an option for editing individual cells in the TreeList pane.

## Basic Concepts

The in-cell edit mode allows users to edit the value of each cell. Each time a cell is clicked or double-clicked, the respective event is emitted, and allows you to call a method that will open the cell in edit mode.

To implement in-cell editing use the following methods and events:

1. When the end user clicks a TreeList cell, this triggers the [`cellClick`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#cellclick) event.
2. The [`TaskClickEvent`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/taskclickevent) data includes the data item, associated with the clicked cell, the `GanttComponent` instance, and the original click event data.
3. To put a cell in edit mode, call the Gantt [`editCell`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#editcell) method

and pass the data item, column identifier, and a [`FormGroup`](https://angular.io/api/forms/FormGroup) instance containing the respective editable fields.

1. Handle the [`cellClose`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#cellclose) event handler to process the Gantt data accordingly. The [`CellCloseEvent`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/cellcloseevent) data contains the `GanttComponent`

instance, the [`TaskEditItem`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/taskedititem), and all properties of the TreeList [`CellCloseEvent`](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/api/cellcloseevent). The event is preventable.

> All tasks should have valid start and end dates where the end date is after the start date.

The following example demonstrates how to set up the in-cell editing mode of the Kendo UI Gantt for Angular using Reactive Forms.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/gantt/editing/in-cell/click/source.txt)

### Editing on Double Click

To put a cell in edit mode when the user double-clicks it, replace the `cellClick` event with [`cellDblClick`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent#celldblclick) in `Step 1` from the [`Basic Concepts`](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/editing/incell#basic-concepts) instructions.

The following example demonstrates how to open the double-clicked cell for editing.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/gantt/editing/in-cell/dbl-click/source.txt)

## Suggested Links

* [API Reference of the GanttComponent](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api/ganttcomponent)
* [API Index of the Gantt](https://www.telerik.com/kendo-angular-ui-develop/components/gantt/api)
