ListViewSubItemCollection
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.5.0.0)
Represents the collection of subitems in a ListViewSubItem item.
- C#
- VB.NET
public class ListViewSubItemCollection : IList, ICollection, IEnumerable, IList<ListViewSubItem>, ICollection<ListViewSubItem>, IEnumerable<ListViewSubItem>
Public Class ListViewSubItemCollection
Inherits IList
Implements ICollection, IEnumerable, IList(Of ListViewSubItem), ICollection(Of ListViewSubItem), IEnumerable(Of ListViewSubItem)
Properties
Count
Int32: Returns the total number of subitems in the collection.
IsReadOnly
Boolean: Returns a value indicating whether the collection is read-only.
Item(index)
ListViewSubItem: Returns or sets the subitem at the specified index in the collection.
Throws:
- ArgumentOutOfRangeException The index value is less than 0 or is greater than the number of items in the collection.
Item(key)
ListViewSubItem: Returns the subitem with the specified key from the collection.
Methods
Add(text)
Adds a new subitem with the specified label text to the end of the current collection.
| Parameter | Type | Description |
|---|---|---|
| text | String | The label text displayed by the ListViewSubItem. |
Returns: ListViewSubItem. A ListViewSubItem that represents the item being added to the collection.
Add(text, foreColor, backColor, font)
Adds a new subitem to the collection with the specified text, foreground color, background color, and font settings.
| Parameter | Type | Description |
|---|---|---|
| text | String | The text to display for the subitem. |
| foreColor | Color | A Color that represents the foreground color of the subitem. |
| backColor | Color | A Color that represents the background color of the subitem. |
| font | Font | A Font that represents the typeface to display the subitem's text in. |
Returns: ListViewSubItem. The ListViewSubItem that was added to the collection.
Add(item)
Adds a previously created subitem to the end of the collection.
| Parameter | Type | Description |
|---|---|---|
| item | ListViewSubItem | The ListViewSubItem to add to the collection. |
Returns: ListViewSubItem. A ListViewSubItem that represents the item being added to the collection.
Throws:
- ArgumentException The item is currently assigned to another ListViewSubItem.
AddRange(items)
Creates new subitems based on an array of strings and adds them to the collection.
| Parameter | Type | Description |
|---|---|---|
| items | String[] | An array of strings representing the text of each subitem to add to the collection. |
AddRange(items, foreColor, backColor, font)
Creates new subitems based on an array of strings and adds them to the collection with the specified foreground color, background color, and font.
| Parameter | Type | Description |
|---|---|---|
| items | String[] | An array of strings representing the text of each subitem to add to the collection. |
| foreColor | Color | A Color that represents the foreground color of the subitem. |
| backColor | Color | A Color that represents the background color of the subitem. |
| font | Font | A Font that represents the typeface to display the subitem's text in. |
AddRange(items)
Adds an array of previously created subitems to the collection.
| Parameter | Type | Description |
|---|---|---|
| items | ListViewSubItem[] | An array of ListViewSubItem to add to the collection. |
Throws:
- ArgumentNullException items is null.
- ArgumentException items is the child of another ListViewSubItem.
Clear()
Removes all ListViewSubItem instances from the collection.
Clear(dispose)
Removes all ListViewSubItem instances from the collection and optionally disposes them.
| Parameter | Type | Description |
|---|---|---|
| dispose | Boolean | Indicates whether the removed items should be disposed. |
Contains(item)
Determines whether the specified subitem is a member of the collection.
| Parameter | Type | Description |
|---|---|---|
| item | ListViewSubItem | The ListViewSubItem to locate in the collection. |
Returns: Boolean. true if the ListViewSubItem is a member of the collection; otherwise, false.
ContainsKey(key)
Determines whether the collection contains a subitem with the specified key.
| Parameter | Type | Description |
|---|---|---|
| key | String | The name of the ListViewSubItem to search for. |
Returns: Boolean. true to indicate the collection contains a ListViewSubItem with the specified key; otherwise, false.
CopyTo(dest, index)
Copies the entire collection into an existing array at a specified location within the array.
| Parameter | Type | Description |
|---|---|---|
| dest | Array | The destination array. |
| index | Int32 | The index in the destination array at which storing begins. |
GetEnumerator()
Returns an enumerator that can be used to iterate through the collection.
Returns: IEnumerator<ListViewSubItem>. An IEnumerator that represents the ListViewSubItemCollection.
IndexOf(subitem)
Returns the index of the specified subitem in the collection.
| Parameter | Type | Description |
|---|---|---|
| subitem | ListViewSubItem | The ListViewSubItem to locate in the collection. |
Returns: Int32. The zero-based index of the item found in the ListViewSubItemCollection; otherwise, -1.
IndexOfKey(key)
Returns the index of the first occurrence of a subitem with the specified key.
| Parameter | Type | Description |
|---|---|---|
| key | String | The name of the ListViewSubItem to search for. |
Returns: Int32. The zero-based index of the first occurrence of a ListViewSubItem with the specified key, if found; otherwise, -1.
Insert(index, item)
Inserts an existing ListViewSubItem into the collection at the specified location.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The indexed location within the collection to insert the subitem. |
| item | ListViewSubItem | The ListViewSubItem to insert into the collection. |
Returns: ListViewSubItem. The ListViewSubItem that was inserted in the collection.
Throws:
- ArgumentException The item is currently assigned to another ListView.
Insert(index, text)
Creates a new subitem with the specified text and inserts it at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The location within the collection to insert the ListViewSubItem. |
| text | String | The text to display in the ListViewSubItem. |
Returns: ListViewSubItem. The ListViewSubItem that was inserted in the collection.
Insert(index, key, text)
Creates a new subitem with the specified text and key, and inserts it into the collection.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The location within the collection to insert the ListViewSubItem. |
| key | String | The name of the ListViewSubItem. |
| text | String | The text to display in theListViewSubItem. |
Returns: ListViewSubItem. The ListViewSubItem that was inserted in the collection.
Remove(item)
Removes the specified subitem from the collection.
| Parameter | Type | Description |
|---|---|---|
| item | ListViewSubItem | The ListViewSubItem to remove. |
RemoveAt(index)
Removes a subitem from the collection at a specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the ListViewSubItem to remove. |
RemoveByKey(key)
Removes the subitem with the specified key from the collection.
| Parameter | Type | Description |
|---|---|---|
| key | String | The name of the ListViewSubItem to remove from the collection. |
Events
CollectionChanged
CollectionChangeEventHandler Fired when the collection changes.