Back to Devexpress

TdxListViewControl Class

vcl-dxlistview.md

latest10.4 KB
Original Source

TdxListViewControl Class

A List View control.

Declaration

delphi
TdxListViewControl = class(
    TdxCustomListView
)

Remarks

The List View control allows you to display a list of items in columns and groups. Each item can include a caption, image, check box, hint, and subitems.

Main API Members

The list below outlines key members of the TdxListViewControl class. These members allow you to manage list view content and customize its appearance.

Common Appearance Settings

All members listed in this section allow you to customize the corresponding appearance settings for all UI element types in the List View control.

FontsProvides access to font settings.ImageOptions

Allows you to specify image sources.

Tip

You can handle OnGetImageIndex and OnGetSubItemImageIndex events to assign specific images to individual list items.

PaddingOptionsProvides access to padding settings.

Content Display-Related API Members

ApplyBestFitAdjusts column width according to content size.ExpandAllGroupsExpands all groups.ExplorerStyleSpecifies if the Windows Explorer-inspired style is enabled (affects all content display modes – Icon, List, Report, and Small Icon).GroupViewSpecifies if the List View control arranges items in defined groups.MakeItemVisibleScrolls content to display the target list item.ViewStyleSwitches the List View control between Icon, List, Report, and Small Icon content display modes.ViewStyleIcon | ViewStyleList | ViewStyleReport | ViewStyleSmallIcon

Provide access to appearance settings for individual List View content display modes.

The ViewStyle property specifies the active display mode.

Content Management

AddItem

Creates a new list item and adds it to the collection accessible through the Items property.

Alternatively, you can call the Items.Add function.

AlphaSort | CustomSort | SortTypeSort list items.ClearDeletes all list items. Alternatively, you can call the Items.Clear procedure.ColumnsProvides access to the list column collection.DeleteSelectedDeletes selected list items (all items accessible through the SelectedItems property).GetCountReturns the total list item count. Alternatively, you can use the Items.Count property.GroupsProvides access to the group collection. The List View control arranges items into groups only if the GroupView property is set to True.Items

Provides access to the list item collection.

Tip

You can use the Items property to add, remove, and access individual items in the List View control.

OnCompareAllows you to implement a custom list item comparison algorithm.

Selection Management

ClearSelectionDeselects all list items.FocusedItemSpecifies the focused list itemMultiSelectSpecifies if users can select multiple list items simultaneously.OnSelectItemAllows you to prevent users from selecting certain items.OnSelectionChangedAllows you to track item focus/selection state changes.SelectedItemCountReturns the number of selected items (items accessible through the SelectedItems property).SelectedItemsProvides access to individual selected list items.

Data-Related API Members

OnData | OnDataFind | OnDataHintAllow you to manage and update list items in virtual mode (when the OwnerData property is set to True).OwnerData

Specifies if the List View control is in virtual mode. This mode reduces memory footprint and allows you to display and manage large numbers of items.

Note

If the OwnerData property is set to True, you need to handle OnData, OnDataFind, and OnDataHint events to manage list items.

ReadOnlySpecifies if the List View control is in read-only mode.

User Action-Related API Members

OnColumnClick | OnColumnDragged | OnColumnPosChanged | OnColumnRightClick | OnColumnSizeChangedAllow you to respond to user interaction with columns.OnDeletionAllows you to respond to an item delete operation (for example, you can clear the current selection).OnEditedAllows you to execute custom code when a user renames a list item (for example, you can modify a newly assigned item caption).OnEditingAllows you to prevent users from editing certain list items.OnInfoTipAllows you to display custom hints for individual list items.

General-Purpose API Members

Assign | AssignToCopy content and settings between List View controls.BeginUpdate | EndUpdateAllow you to avoid excessive redraw operations during batch content and appearance changes.UpdateItemsUpdates all existing list view items.

Inheritance

Show 11 items

TObject TPersistent TComponent TControl TWinControl TCustomControl TcxCustomControl TcxControl TcxScrollingControl TdxCustomListView TdxListViewControl

See Also

TdxListViewControl Class

TdxListViewControl Members

dxListView Unit