Back to Devexpress

TdxListViewSelectItemEvent Type

vcl-dxlistview-b454f046.md

latest1.4 KB
Original Source

TdxListViewSelectItemEvent Type

The procedural type for list item selection handlers.

Declaration

delphi
TdxListViewSelectItemEvent = procedure(Sender: TdxCustomListView; AItem: TdxListItem; ASelected: Boolean) of object;

Parameters

NameTypeDescription
SenderTdxCustomListView

The List View control that raised the event.

| | AItem | TdxListItem |

The target list item.

| | ASelected | Boolean |

The item’s selection state.

|

Remarks

The following OnSelectItem event handler prohibits a user from selecting an item:

delphi
procedure TForm1.dxListViewControl1SelectItem(Sender: TdxCustomListView;
  AItem: TdxListItem; ASelected: Boolean);
begin
  if ASelected then
    AItem.Selected := False;
end;
cpp
void __fastcall TForm1::dxListViewControl1SelectItem(TdxCustomListView *Sender,
  TdxListItem *AItem, bool &ASelected)
{
  if (ASelected)
    AItem->Selected = false;
}

The List View’s OnSelectItem event references the TdxListViewSelectItemEvent type.

See Also

dxListView Unit