<div class="meta" robots="noindex">

</div>

# ListBox.EditCell

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `DesktopListBox.EditCellAt<desktoplistbox.editcellat>` as a replacement.

</div>

## Description

Scrolls the *row*, *column* cell into view (if necessary) and temporarily makes the cell editable. *row* and *column* are zero-based. It sets the focus within the ListBox to the *row*, *column* cell and selects its contents, if any. The editable cell has a focus ring around it.

## Notes

Use the `CellTypeAt<listbox.celltypeat>` or `ColumnTypeAt<listbox.columntypeat>` properties to change a cell or column to “inline editable” when you want the user to be able to edit the contents of the ListBox. Then call the <span class="title-ref">EditCell</span> method for each cell. This gives the editable cell the focus and selects the current text of the cell, if any. Typing replaces the cell's contents. When the user presses Tab or Return or clicks in another cell, the cell loses the focus and the contents of the cell are saved (this also calls the `CellAction<listbox.cellaction>` event handler).

When a cell is editable, the `ActiveTextControl<listbox.activetextcontrol>` property is the `TextEdit</api/deprecated/textedit>` that contains the contents of that cell. This may be a `TextField</api/deprecated/textfield>` or a `TextArea</api/deprecated/textarea>` depending on the specified column type. You can use this property to set or get the text of the Listbox cell, set the selection, or change other properties of the ListBox's TextField or TextArea.

## Sample code

The following code in the CellClick event makes the cell the user clicked on editable. The parameters *row* and *column* are passed to the function.

``` xojo
Me.CellTypeAt(row, column) = Listbox.TypeEditableTextField
Me.EditCell(row, column)
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This code marks an entire column as editable:

``` xojo
ListBox1.ColumnType(3) = ListBox.TypeEditableTextArea
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

In the `CellClick<listbox.cellclick>` event handler, you can then check if the column was clicked and then enable editing:

``` xojo
If column = 3 Then
  Me.EditCell(row, column)
End If
```

## Compatibility

All projects types on all supported operating systems.
