ListView.OnSelectingItem

Syntax

Sub OnSelectingItem(Sender: Object; Args: IListViewActionEventArgs);

Begin

//set of operators;

End Sub OnSelectingItem;

Parameters

Sender. Parameter that returns the component that generated the event.

Args. Parameter that enables the user to determine event parameters.

Description

The OnSelectingItem event occurs before changing selection for the component element.

Example

Executing the example requires a form, the ListView component named ListView1 placed on it. Several elements have been created for the component.

Sub ListView1OnSelectingItem(Sender: Object; Args: IListViewActionEventArgs);

Begin

If (Args.Item.Text = "3") Then

Args.Allowed := False;

End If;

End Sub ListView1OnSelectingItem;

After executing the example, when the selection of the elements in the component is changed, if text of the element corresponds to 3, it is prohibited to change selection of this element.

See also:

ListView