TdxListViewControl Class
A List View control.
#Declaration
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.
- Fonts
- Provides access to font settings.
- ImageOptions
Allows you to specify image sources.
Tip
You can handle On
Get and OnImage Index Get events to assign specific images to individual list items.Sub Item Image Index - PaddingOptions
- Provides access to padding settings.
#Content Display-Related API Members
- ApplyBestFit
- Adjusts column width according to content size.
- ExpandAllGroups
- Expands all groups.
- ExplorerStyle
- Specifies if the Windows Explorer-inspired style is enabled (affects all content display modes – Icon, List, Report, and Small Icon).
- GroupView
- Specifies if the List View control arranges items in defined groups.
- MakeItemVisible
- Scrolls content to display the target list item.
- ViewStyle
- Switches 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 | SortType
- Sort list items.
- Clear
- Deletes all list items. Alternatively, you can call the Items.Clear procedure.
- Columns
- Provides access to the list column collection.
- DeleteSelected
- Deletes selected list items (all items accessible through the SelectedItems property).
- GetCount
- Returns the total list item count. Alternatively, you can use the Items.Count property.
- Groups
- Provides 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.
- OnCompare
- Allows you to implement a custom list item comparison algorithm.
#Selection Management
- ClearSelection
- Deselects all list items.
- FocusedItem
- Specifies the focused list item
- MultiSelect
- Specifies if users can select multiple list items simultaneously.
- OnSelectItem
- Allows you to prevent users from selecting certain items.
- OnSelectionChanged
- Allows you to track item focus/selection state changes.
- SelectedItemCount
- Returns the number of selected items (items accessible through the SelectedItems property).
- SelectedItems
- Provides access to individual selected list items.
#Data-Related API Members
- OnData | OnDataFind | OnDataHint
- Allow 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 Owner
Data property is set toTrue
, you need to handle OnData , OnData , and OnFind Data events to manage list items.Hint - ReadOnly
- Specifies if the List View control is in read-only mode.
#User Action-Related API Members
- OnColumnClick | OnColumnDragged | OnColumnPosChanged | OnColumnRightClick | OnColumnSizeChanged
- Allow you to respond to user interaction with columns.
- OnDeletion
- Allows you to respond to an item delete operation (for example, you can clear the current selection).
- OnEdited
- Allows you to execute custom code when a user renames a list item (for example, you can modify a newly assigned item caption).
- OnEditing
- Allows you to prevent users from editing certain list items.
- OnInfoTip
- Allows you to display custom hints for individual list items.
#General-Purpose API Members
- Assign | AssignTo
- Copy content and settings between List View controls.
- BeginUpdate | EndUpdate
- Allow you to avoid excessive redraw operations during batch content and appearance changes.
- UpdateItems
- Updates all existing list view items.