Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxListViewCreateItemClassEvent Type

The procedural type for list item creation handlers.

#Declaration

Delphi
TdxListViewCreateItemClassEvent = procedure(Sender: TdxCustomListView; var AItemClass: TdxListItemClass) of object;

#Parameters

Name Type Description
Sender TdxCustomListView

The List View control that raised the event.

AItemClass TdxListItemClass

A class-reference to the added item class. The assigned class should be a descendant of the TdxListItem class.

#Remarks

The following code specifies a TdxListItem class descendant whose instances store their time of creation and the ListView’s OnCreateItemClass event handler that adds the custom-defined item instead of the standard item:

type
  MyItem = class(TdxListItem)
  private
    Created: TDateTime;
  public
    constructor Create(AOwner: TdxListItems); virtual;
end;

constructor MyItem.Create(AOwner: TdxListItems);
begin
  inherited Create(AOwner);
  Created := Now;
end;

procedure TForm1.dxListViewControl1CreateItemClass(Sender: TdxCustomListView;
  var AItemClass: TdxListItemClass);
begin
  AItemClass := MyItem;
end;

The List View’s OnCreateItemClass event references the TdxListViewCreateItemClassEvent type.

See Also