Table of Contents

Class ListViewItem

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Represents an item in a ListView control.

public class ListViewItem : BaseControlItem, IBaseControlItem, IBaseObject
Inheritance
ListViewItem
Implements

Remarks

The ListViewItem class defines the appearance, behavior, and data associated with an item that is displayed in the ListView control. ListViewItem objects can be displayed in the ListView control in one of several different views defined by ListViewView enumeration.

Most of the properties of the ListViewItem class provide ways to change the display of the item in the ListView control it is associated with. The Text property allows you to specify the text displayed in the item.

The ImageIndex property allows you to specify the image to load from the ImageList that is assigned to the ListView control (by setting the LargeImageList or SmallImageList properties of the ListView).

Items can display any number of cells when the View property of the associated ListView control is set to Details and columns are defined by the Columns property of the ListView control. You can add cells to an item by using Cells property of the ListViewItem.

Constructors

ListViewItem()

Initializes a new instance of the ListViewItem class with default values.

ListViewItem(string, int?)

Initializes a new instance of the ListViewItem class with the specified item text and the image index position of the item's icon.

ListViewItem(string[], int?)

Initializes a new instance of the ListViewItem class with an array of strings representing column cells and the image index position of the item's icon.

Properties

Cells

Gets a collection containing all column cells of the item.

ImageIndex

Gets or sets the index of the image that is displayed for the item.

Index

Gets the zero-based index of the item within the ListView control, or null if the item is not associated with a ListView control.

IsFocused

Gets or sets a value indicating whether the item has focus within the ListView control.

IsSelected

Gets a value indicating whether the item is in the selected state.

ListView

Gets the owner ListView that the tree item is assigned to.

Text

Gets or sets the text of the item.

Methods

ApplyColumns()

Appllies columns to the owner control. Do not call directly.

Assign(ListViewItem)

Assigns properties from another ListViewItem.

BeginLabelEdit()

Initiates the editing of the list view item label.

Clone()

Creates copy of this ListViewItem.

EnsureVisible()

Ensures that the item is visible within the control, scrolling the contents of the control, if necessary.

GetItemBounds(ListViewItemBoundsPortion)

Retrieves the bounding rectangle for this item.

InternalSetListViewAndIndex(ListView?, long?)

Sets owner control and item index. Do not call directly.

ToString()

Returns a string that represents the current object.