# Angular TreeList Preventing Editing for Specific Fields

The [Angular TreeList](https://www.telerik.com/kendo-angular-ui/components/treelist) allows you to restrict users from editing specific fields. This is suitable when you want some columns to stay the same, while still letting users edit the rest of the information.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/editing/preventing/source.txt)

To prevent editing specific cells, you can use any of the following approaches:

* Disable editing for selected fields, such as IDs, by setting the built-in [`editable`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/columncomponent#editable) option of the respective column(s) to `false`.

  ```html
  <kendo-treelist ... >
      <kendo-treelist-column field="id" [editable]="false"></kendo-treelist-column>
      ...
  </kendo-treelist>
  ```

* Omit the field(s) declaration in the `FormGroup`.

  ```ts
  private createFormGroup(item: any): FormGroup {
      return new FormGroup({
          id: new FormControl(item.id),
          parentId: new FormControl(item.parentId),
          name: new FormControl(item.name, Validators.required),
          role: new FormControl(item.role),
          // specialty field is intentionally omitted to prevent editing
      });
  }
  ```

* Skip the [`editCell`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#editcell) method invocation in the [`cellClick`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#cellclick) event handler.

  ```ts
  public cellClickHandler({ sender, column, columnIndex, dataItem, isEdited }: CellClickEvent): void {
      const readonly = this.readOnlyColumns.has(column.field);
      if (!isEdited && !readonly) {
          sender.editCell(dataItem, columnIndex, this.createFormGroup(dataItem));
      }
  }
  ```

## See Also

* [API Reference of the TreeListComponent](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent)
* [Angular TreeList Editing Basics](https://www.telerik.com/kendo-angular-ui/components/treelist/editing)
* [API Index of the TreeList](https://www.telerik.com/kendo-angular-ui/components/treelist/api)
