[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TCustomListView.CanEdit

Determines if the specified list Item can be edited in the control.

## Declaration

Source position: comctrls.pp line 1529

`protected function TCustomListView.CanEdit(`
`Item: TListItem`
`):Boolean; virtual;`

## Arguments

`Item` |  | List item to examine in the method.

## Function result

True if the editor can be displayed and activated for the specified list item.

## Description

CanEdit is a Boolean function used to determine if the editor can be displayed and activated for the specified list Item. The default return value is True.

CanEdit signals the OnEditing event handler (when assigned) where the return value can be modified. The event handler can examine values in the Item argument, the list view instance, or use other user-specified criteria to determine the return value.

CanEdit is called from the ShowEditor method, and occurs before the Editor in the control is configured and displayed. Use the Readonly property to prevent ShowEditor from being called when keyboard (F2) and mouse click events are handled in the control.

## See also

TCustomListView.OnEditing |  | Event handler signalled to determine if editing can be performed for a list item in the control.
TCustomListView.Items |  | Collection of list items displayed on the list view control.
TCustomListView.OwnerData |  | Enables or disables owner data (virtual) mode for the list view control.
TCustomListView.Readonly |  | Disables editing of list items on the control when set to True.
TCustomListView.SelCount |  | Number of currently selected Items when MultiSelect is enabled.
TListItem |  | Represents the items created in TCustomListView and descendants.