ListViewItem
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Represents an item in a ListView control.
- C#
- VB.NET
public class ListViewItem : ICloneable, IDisposable, IHasPropertyStore, IImage, IUserData
Public Class ListViewItem
Inherits ICloneable
Implements IDisposable, IHasPropertyStore, IImage, IUserData
Constructors
ListViewItem()
Initializes a new instance of the ListViewItem class with default values.
ListViewItem(text)
Initializes a new instance of the ListViewItem class with the specified item text.
| Name | Type | Description |
|---|---|---|
| text | String | The text to display for the item. |
ListViewItem(items)
Initializes a new instance of the ListViewItem class with an array of strings representing sub-items.
| Name | Type | Description |
|---|---|---|
| items | String[] | An array of strings that represent the sub-items of the new item. |
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.
| Name | Type | Description |
|---|---|---|
| text | String | The text to display for the item. |
| imageIndex | Int32 | The zero-based index of the image within the ImageList associated with the ListView that contains the item. |
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.
| Name | Type | Description |
|---|---|---|
| items | String[] | An array of strings that represent the sub-items of the new item. |
| imageIndex | Int32 | The zero-based index of the image within the ImageList associated with the ListView that contains the item. |
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.
| Name | Type | Description |
|---|---|---|
| items | String[] | An array of strings that represent the sub-items of the new item. |
| imageIndex | Int32 | The zero-based index of the image within the ImageList associated with the ListView that contains the item. |
| foreColor | Color | A Color that represents the foreground color of the item. |
| backColor | Color | A Color that represents the background color of the item. |
| font | Font | A Font that represents the font to display the item's text in. |
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.
| Name | Type | Description |
|---|---|---|
| subItems | ListViewSubItem[] | An array of type ListViewSubItem that represents the sub-items of the item. |
| imageIndex | Int32 | The zero-based index of the image within the ImageList associated with the ListView that contains the item. |
ListViewItem(text, imageKey)
Initializes a new instance of the ListViewItem class with the specified text and image.
| Name | Type | Description |
|---|---|---|
| text | String | The text to display for the item. This should not exceed 259 characters. |
| imageKey | String | The name of the image within the ImageList of the owning ListView to display in the ListViewItem. |
ListViewItem(items, imageKey)
Initializes a new instance of the ListViewItem class with the specified item and sub-item text and image.
| Name | Type | Description |
|---|---|---|
| items | String[] | An array containing the text of the sub-items of the ListViewItem. |
| imageKey | String | The name of the image within the ImageList of the owning ListView to display in the ListViewItem. |
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.
| Name | Type | Description |
|---|---|---|
| items | String[] | An array of strings that represent the text of the sub-items for the ListViewItem. |
| imageKey | String | The name of the image within the ImageList of the owning ListView to display in the item. |
| foreColor | Color | A Color that represents the foreground color of the item. |
| backColor | Color | A Color that represents the background color of the item. |
| font | Font | A Font to apply to the item text. |
ListViewItem(subItems, imageKey)
Initializes a new instance of the ListViewItem class with the specified sub-items and image.
| Name | Type | Description |
|---|---|---|
| subItems | ListViewSubItem[] | An array of ListViewSubItem objects. |
| imageKey | String | The name of the image within the ImageList of the owning ListView to display in the ListViewItem. |
Properties
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/>".
BackColor
Color: Returns or sets the background color of the ListView.
Checked
Boolean: Returns or sets whether the item is checked. (Default: False)
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:
- ArgumentOutOfRangeException The value is lower than 1 or greater than 100.
ContextMenu
ContextMenu: Returns or sets the shortcut menu associated with the item. (Default: null)
Control
Control: Returns or sets a child control to display inside the item.
DataBoundItem
Object: Returns the data-bound object for this ListViewItem.
Focused
Boolean: Return or sets whether the item has the focus within the ListView parent.
Font
Font: Returns or sets the font of the text displayed by the ListView.
ForeColor
Color: Returns or sets the foreground color of the ListView.
HasUserData
Boolean: Checks if the UserData dynamic object was created and has any value.
Image
Image: Returns or sets the image that is displayed on a ListViewItem.
ImageIndex
Int32: Returns or sets the image list index value of the image displayed in the ListViewItem. (Default: -1)
Throws:
- ArgumentOutOfRangeException The specified index is less than -1.
ImageKey
String: Returns or sets the key accessor for the image in the ImageList. (Default: "")
ImageList
ImageList: Returns the ImageList that contains the images displayed in the ListViewItem.
ImageSource
String: Returns or sets the theme name or URL for the image to display in the ListViewItem.
Index
Int32: Returns the zero-based index of the item within the ListView control.
IsDataBound
Boolean: Returns whether the ListViewItem is data bound.
IsEditing
Boolean: Returns a value indicating whether the tree node is in an editable state.
ListView
ListView: Returns the ListView control that contains the item.
Name
String: Returns or sets the name associated with this item.
RowHeight
Int32: Returns or sets the height of the row corresponding to this item when in Details view.
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:
- ArgumentOutOfRangeException The value is lower than 1 or greater than 100.
Selected
Boolean: Returns or sets whether the item is selected.
StateImageIndex
Int32: Returns or sets the image list index value of the state icon displayed in the ListViewItem. (Default: -1)
Throws:
- ArgumentOutOfRangeException The specified index is less than -1.
StateImageKey
String: Returns or sets the key for the state icon displayed in the ImageList. (Default: "")
StateImageList
ImageList: Returns the ImageList that contains the state images displayed in the ListViewItem.
StateImageSource
String: Returns or sets the theme name or URL for the state icon to display in the ListViewItem.
SubItems
ListViewSubItemCollection: Returns a collection containing all sub items.
Tag
Object: Returns or sets an object that contains data to associate with the item. (Default: null)
Text
String: Returns or sets the text of the item. (Default: "")
ToolTipText
String: Returns or sets the text shown when the mouse pointer rests on the ListViewItem. (Default: "")
UserData
Object: Returns a dynamic object that can be used to store custom data in relation to this item.
Visible
Boolean: Returns or sets whether the item is visible.
Methods
BeginEdit()
Places the item in edit mode.
Throws:
- InvalidOperationException The LabelEdit property of the associated ListView is not set to true.
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.
Dispose()
Releases all resources used by the ListViewItem.
Dispose(disposing)
Releases the resources used by the ListViewItem.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | true when this method is called by the application rather than a finalizer. |
EnsureVisible()
Ensures that the item is visible within the control, scrolling the contents of the control, if necessary.
Finalize()
Destructor dispose pattern.
Remove()
Removes the item from its associated ListView control.