# ListViewItem.ListViewSubItem

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

Represents a sub-item of a [ListViewItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.md).

{% tabs %}
{% tab title="C#" %}

```csharp
public class ListViewSubItem : IDisposable, IHasPropertyStore, IUserData
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class ListViewSubItem
    Inherits IDisposable
    Implements IHasPropertyStore, IUserData
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) ListViewSubItem()

Initializes a new instance of the [ListViewSubItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.listviewsubitem.md) class.

### ![](/files/hsR4ok3152WyAf8J2C1u) ListViewSubItem(owner, text)

Initializes a new instance of the [ListViewSubItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.listviewsubitem.md) class with the specified owner and text.

| Name      | Type                                                                              | Description                                                                                                                          |
| --------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **owner** | [ListViewItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.md) | A [ListViewItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.md) that represents the item that owns the sub item. |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string)                     | The text to display for the sub item.                                                                                                |

### ![](/files/hsR4ok3152WyAf8J2C1u) ListViewSubItem(owner, text, foreColor, backColor, font)

Initializes a new instance of the [ListViewSubItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.listviewsubitem.md) class with the specified owner, text, foreground color, background color, and font values.

| Name          | Type                                                                              | Description                                                                                                                          |
| ------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **owner**     | [ListViewItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.md) | A [ListViewItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.md) that represents the item that owns the sub item. |
| **text**      | [String](https://docs.microsoft.com/dotnet/api/system.string)                     | The text to display for the sub item.                                                                                                |
| **foreColor** | [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color)               | A [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) that represents the foreground color of the sub item.          |
| **backColor** | [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color)               | A [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) that represents the background color of the sub item.          |
| **font**      | [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font)                 | A [Font](#font) that represents the font to display the sub item's text in.                                                          |

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) AllowHtml

[Boolean](https://docs.microsoft.com/dotnet/api/system.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/>".

### ![](/files/hsR4ok3152WyAf8J2C1u) BackColor

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color): Returns or sets the background color of the [ListViewSubItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.listviewsubitem.md).

### ![](/files/hsR4ok3152WyAf8J2C1u) ColSpan

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the number of columns that this sub-item can use to render its content when the [ListView](/api/wisej.web/lists-and-grids/listview.md) is in [Details](/api/wisej.web/lists-and-grids/listview/wisej.web.view.md#fields) mode. (Default: `1`)

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The value is lower than 1 or greater than 100.

### ![](/files/hsR4ok3152WyAf8J2C1u) Control

[Control](/api/wisej.web/general/control.md): Returns or sets a child control to display inside the sub-item.

### ![](/files/hsR4ok3152WyAf8J2C1u) Font

[Font](https://docs.microsoft.com/dotnet/api/system.drawing.font): Returns or sets the font of the text displayed by the [ListViewSubItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.listviewsubitem.md).

### ![](/files/hsR4ok3152WyAf8J2C1u) ForeColor

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color): Returns or sets the foreground color of the [ListViewSubItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.listviewsubitem.md).

### ![](/files/hsR4ok3152WyAf8J2C1u) HasUserData

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Checks if the [UserData](#userdata) dynamic object was created and has any value.

### ![](/files/hsR4ok3152WyAf8J2C1u) Name

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the name associated with this subitem.

### ![](/files/hsR4ok3152WyAf8J2C1u) RowSpan

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the number of rows that this sub-item can use to render its content when the [ListView](/api/wisej.web/lists-and-grids/listview.md) is in [Details](/api/wisej.web/lists-and-grids/listview/wisej.web.view.md#fields) mode. (Default: `1`)

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The value is lower than 1 or greater than 100.

### ![](/files/hsR4ok3152WyAf8J2C1u) Tag

[Object](https://docs.microsoft.com/dotnet/api/system.object): Returns or sets an object that contains data to associate with the sub-item. (Default: `null`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Text

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the text of the sub item.

### ![](/files/hsR4ok3152WyAf8J2C1u) UserData

[Object](https://docs.microsoft.com/dotnet/api/system.object): Returns a dynamic object that can be used to store custom data in relation to this item.

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) Dispose()

Releases all resources used by the [ListViewSubItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.listviewsubitem.md).

### ![](/files/lzopMboA31bVq8UIcbT3) Dispose(disposing)

Releases the resources used by the [ListViewSubItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.listviewsubitem.md).

| Parameter     | Type                                                            | Description                                                                 |
| ------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true when this method is called by the application rather than a finalizer. |

### ![](/files/lzopMboA31bVq8UIcbT3) Finalize()

Destructor dispose pattern.

## Implements

| Name                                                          | Description                                                                                                     |
| ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata.md) | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.listviewsubitem.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
