Skip to main content
Version: 4.1

ListViewItem

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents an item in a ListView control.

public class ListViewItem : ICloneable, IDisposable, IHasPropertyStore, IImage, IUserData

Constructors​

Instance member ListViewItem()​

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

Instance member ListViewItem(text)​

Initializes a new instance of the ListViewItem class with the specified item text.

NameTypeDescription
textStringThe text to display for the item.

Instance member ListViewItem(items)​

Initializes a new instance of the ListViewItem class with an array of strings representing sub-items.

NameTypeDescription
itemsString[]An array of strings that represent the sub-items of the new item.

Instance member ListViewItem(text, imageIndex)​

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

NameTypeDescription
textStringThe text to display for the item.
imageIndexInt32The zero-based index of the image within the ImageList associated with the ListView that contains the item.

Instance member ListViewItem(items, imageIndex)​

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

NameTypeDescription
itemsString[]An array of strings that represent the sub-items of the new item.
imageIndexInt32The zero-based index of the image within the ImageList associated with the ListView that contains the item.

Instance member ListViewItem(items, imageIndex, foreColor, backColor, font)​

Initializes a new instance of the ListViewItem class with the image index position of the item's icon; the foreground color, background color, and font of the item; and an array of strings representing sub-items.

NameTypeDescription
itemsString[]An array of strings that represent the sub-items of the new item.
imageIndexInt32The zero-based index of the image within the ImageList associated with the ListView that contains the item.
foreColorColorA Color that represents the foreground color of the item.
backColorColorA Color that represents the background color of the item.
fontFontA Font that represents the font to display the item's text in.

Instance member ListViewItem(subItems, imageIndex)​

Initializes a new instance of the ListViewItem class with the image index position of the item's icon and an array of ListViewSubItem objects.

NameTypeDescription
subItemsListViewSubItem[]An array of type ListViewSubItem that represents the sub-items of the item.
imageIndexInt32The zero-based index of the image within the ImageList associated with the ListView that contains the item.

Instance member ListViewItem(text, imageKey)​

Initializes a new instance of the ListViewItem class with the specified text and image.

NameTypeDescription
textStringThe text to display for the item. This should not exceed 259 characters.
imageKeyStringThe name of the image within the ImageList of the owning ListView to display in the ListViewItem.

Instance member ListViewItem(items, imageKey)​

Initializes a new instance of the ListViewItem class with the specified item and sub-item text and image.

NameTypeDescription
itemsString[]An array containing the text of the sub-items of the ListViewItem.
imageKeyStringThe name of the image within the ImageList of the owning ListView to display in the ListViewItem.

Instance member ListViewItem(items, imageKey, foreColor, backColor, font)​

Initializes a new instance of the ListViewItem class with the sub-items containing the specified text, image, colors, and font.

NameTypeDescription
itemsString[]An array of strings that represent the text of the sub-items for the ListViewItem.
imageKeyStringThe name of the image within the ImageList of the owning ListView to display in the item.
foreColorColorA Color that represents the foreground color of the item.
backColorColorA Color that represents the background color of the item.
fontFontA Font to apply to the item text.

Instance member ListViewItem(subItems, imageKey)​

Initializes a new instance of the ListViewItem class with the specified sub-items and image.

NameTypeDescription
subItemsListViewSubItem[]An array of ListViewSubItem objects.
imageKeyStringThe name of the image within the ImageList of the owning ListView to display in the ListViewItem.

Properties​

Instance member AllowHtml​

Boolean: Returns or sets a value indicating that the item can display HTML text. (Default: False)

When AllowHtml is set to true, the text in the item can contain HTML content. If the text contains new lines (CRLF) but doesn't contain HTML elements (at least one "<") all CRLF are automatically substituted with "<br/>".

Instance member BackColor​

Color: Returns or sets the background color of the ListView.

Value: A Color that represents the background color of the item's text.

Instance member Checked​

Boolean: Returns or sets whether the item is checked. (Default: False)

Value: true if the item is checked; otherwise, false. The default is false.

Instance member ColSpan​

Int32: Returns or sets the number of columns that this item can use to render its content when the ListView is in Details mode. (Default: 1)

Throws:

Instance member ContextMenu​

ContextMenu: Returns or sets the shortcut menu associated with the item. (Default: null)

Value: The ContextMenu associated with the cell.

Instance member Control​

Control: Returns or sets a child control to display inside the item.

Instance member DataBoundItem​

Object: Returns the data-bound object for this ListViewItem.

Value: The data-bound Object.

Instance member Focused​

Boolean: Return or sets whether the item has the focus within the ListView parent.

Value: true if the item has focus; otherwise, false.

Instance member Font​

Font: Returns or sets the font of the text displayed by the ListView.

Value: The Font to apply to the text displayed by the control.

Instance member ForeColor​

Color: Returns or sets the foreground color of the ListView.

Value: A Color that represents the foreground color of the item's text.

Instance member HasUserData​

Boolean: Checks if the UserData dynamic object was created and has any value.

Instance member Image​

Image: Returns or sets the image that is displayed on a ListViewItem.

Value: An Image displayed on the ListViewItem. The default is null.

Instance member ImageIndex​

Int32: Returns or sets the image list index value of the image displayed in the ListViewItem. (Default: -1)

Value: A zero-based index, which represents the image position in an ImageList. The default is -1.

Throws:

Instance member ImageKey​

String: Returns or sets the key accessor for the image in the ImageList. (Default: "")

Value: A string representing the key of the image.

Instance member ImageList​

ImageList: Returns the ImageList that contains the images displayed in the ListViewItem.

Value: The ImageList used by the ListView control that owns this ListViewItem.

Instance member ImageSource​

String: Returns or sets the theme name or URL for the image to display in the ListViewItem.

Value: The theme name or URL for the image to display in the item.

Instance member Index​

Int32: Returns the zero-based index of the item within the ListView control.

Value: The zero-based index of the item within the ListViewItemCollection of the ListView control, or -1 if the item is not associated with a ListView control.

Instance member IsDataBound​

Boolean: Returns whether the ListViewItem is data bound.

Instance member IsEditing​

Boolean: Returns a value indicating whether the tree node is in an editable state.

Value: true if the tree node is in editable state; otherwise, false.

Instance member ListView​

ListView: Returns the ListView control that contains the item.

Value: A ListView that contains the ListViewItem.

Instance member Name​

String: Returns or sets the name associated with this item.

Value: The name of the ListViewItem. The default is an empty string ("").

Instance member RowHeight​

Int32: Returns or sets the height of the row corresponding to this item when in Details view.

Instance member RowSpan​

Int32: Returns or sets the number of rows that this item can use to render its content when the ListView is in Details mode. (Default: 1)

Throws:

Instance member Selected​

Boolean: Returns or sets whether the item is selected.

Value: true if the item is selected; otherwise, false.

Instance member StateImageIndex​

Int32: Returns or sets the image list index value of the state icon displayed in the ListViewItem. (Default: -1)

Value: A zero-based index, which represents the image position in an ImageList. The default is -1.

Throws:

Instance member StateImageKey​

String: Returns or sets the key for the state icon displayed in the ImageList. (Default: "")

Value: A string representing the key of the image.

Instance member StateImageList​

ImageList: Returns the ImageList that contains the state images displayed in the ListViewItem.

Value: The state ImageList used by the ListView control that owns this ListViewItem.

Instance member StateImageSource​

String: Returns or sets the theme name or URL for the state icon to display in the ListViewItem.

Value: The theme name or URL for the image to display in the button control.

Instance member SubItems​

ListViewSubItemCollection: Returns a collection containing all sub items.

Value: A ListViewSubItemCollection that contains the sub items.

Instance member Tag​

Object: Returns or sets an object that contains data to associate with the item. (Default: null)

Value: An object that contains information that is associated with the item.

Instance member Text​

String: Returns or sets the text of the item. (Default: "")

Value: The text to display for the item.

Instance member ToolTipText​

String: Returns or sets the text shown when the mouse pointer rests on the ListViewItem. (Default: "")

Value: The text shown when the mouse pointer rests on the ListViewItem.

Instance member UserData​

Object: Returns a dynamic object that can be used to store custom data in relation to this item.

Instance member Visible​

Boolean: Returns or sets whether the item is visible.

Value: true if the item is visible; otherwise, false.

Methods​

Instance member BeginEdit()​

Places the item in edit mode.

Throws:

Instance member Clone()​

Creates an identical copy of the item.

Returns: Object. An object that represents an item that has the same text, image, and sub-items associated with it as the cloned item.

Instance member Dispose()​

Releases all resources used by the ListViewItem.

Protected member Dispose(disposing)​

Releases the resources used by the ListViewItem.

ParameterTypeDescription
disposingBooleantrue when this method is called by the application rather than a finalizer.

Instance member EnsureVisible()​

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

Protected member Finalize()​

Destructor dispose pattern.

Instance member Remove()​

Removes the item from its associated ListView control.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IImageProvides access to common image properties across the controls that implement this interface.