# ListControl

Namespace: **Wisej.Web**

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

* [Control](/api/v3.0/wisej.web/general/control.md)
  * [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md)

Provides a common implementation of members for the [ListBox](/api/v3.0/wisej.web/lists-and-grids/listbox.md) and [ComboBox](/api/v3.0/wisej.web/lists-and-grids/combobox.md) classes.

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

```csharp
public class ListControl : Control
```

{% endtab %}

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

```visual-basic
Public Class ListControl
    Inherits Control
```

{% endtab %}
{% endtabs %}

## Properties

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

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns or sets a value indicating that the control can display html in the Text property.

### ![](/files/uCY6T77rh488FWHzpJ6P)BorderStyle

[BorderStyle](/api/v3.0/wisej.web/enumerations/wisej.web.borderstyle.md): Returns or sets the type of border that is drawn around the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md).

### ![](/files/uCY6T77rh488FWHzpJ6P)DataSource

[Object](https://docs.microsoft.com/en-us/dotnet/api/system.object): Returns or sets the data source for this [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md).

**Throws:**

* [ArgumentException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentexception) The assigned value does not implement the [IList](https://docs.microsoft.com/en-us/dotnet/api/system.collections.ilist) or [IListSource](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.ilistsource) interfaces.

### ![](/files/uCY6T77rh488FWHzpJ6P)DisplayMember

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets the property to display for this [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md).

### ![](/files/uCY6T77rh488FWHzpJ6P)FormatInfo

[IFormatProvider](https://docs.microsoft.com/en-us/dotnet/api/system.iformatprovider): Returns or sets the [IFormatProvider](https://docs.microsoft.com/en-us/dotnet/api/system.iformatprovider) that provides custom formatting behavior.

### ![](/files/uCY6T77rh488FWHzpJ6P)FormatString

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets the format-specifier characters that indicate how a value is to be displayed.

### ![](/files/uCY6T77rh488FWHzpJ6P)FormattingEnabled

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns or sets whether formatting is applied to the [DisplayMember](#displaymember) property of the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md).

### ![](/files/uCY6T77rh488FWHzpJ6P)IconMember

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets the property to use as the icon for the items in the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md).

### ![](/files/uCY6T77rh488FWHzpJ6P)Invalid

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns or sets a value that indicates that the control is invalid.

### ![](/files/uCY6T77rh488FWHzpJ6P)InvalidMessage

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets the invalid message that is shown in the invalid tooltip.

### ![](/files/uCY6T77rh488FWHzpJ6P)Modified

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns or sets a value that indicates that the control has been modified by the user since the control was created or its contents were last set.

### ![](/files/uCY6T77rh488FWHzpJ6P)PrefetchItems

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32): Returns or sets the number of items to prefetch outside of the visible area when [VirtualScroll](#virtualscroll) is set to true. The default is 0 (disabled).

### ![](/files/uCY6T77rh488FWHzpJ6P)SelectedIndex

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32): When overridden in a derived class, gets or sets the zero-based index of the currently selected item.

### ![](/files/uCY6T77rh488FWHzpJ6P)SelectedValue

[Object](https://docs.microsoft.com/en-us/dotnet/api/system.object): Returns or sets the value of the member property specified by the [ValueMember](#valuemember) property.

**Throws:**

* [InvalidOperationException](https://docs.microsoft.com/en-us/dotnet/api/system.invalidoperationexception) The assigned value is null or the empty string ("").

### ![](/files/uCY6T77rh488FWHzpJ6P)ShowToolTips

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns or sets whether to show tooltips (set using [ToolTipMember](#tooltipmember)) for the list items.

### ![](/files/uCY6T77rh488FWHzpJ6P)ToolTipMember

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets the property to use as the tooltip for the items in the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md), when the property [ShowToolTips](#showtooltips) is set to true.

### ![](/files/uCY6T77rh488FWHzpJ6P)ValueMember

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets the property to use as the actual value for the items in the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md).

**Throws:**

* [ArgumentException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentexception) The specified property cannot be found on the object specified by the [DataSource](#datasource) property.

### ![](/files/uCY6T77rh488FWHzpJ6P)VirtualScroll

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Enables or disables virtual scrolling for the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md). When virtual scrolling is enabled, only the visible items are rendered in the browser allowing the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md) to host virtually unlimited items without any performance loss.

When [VirtualScroll](#virtualscroll) is set to true, all the items must be of the same height, limiting the more flexible HTML rendering available when [VirtualScroll](#virtualscroll) is off (default). Setting the property [PrefetchItems](#prefetchitems) to a value greater than 0 allows the virtual view to prefetch the specified number of items outside of the visible area to enable smoother scrolling.

## Methods

### ![](/files/uCY6T77rh488FWHzpJ6P)Append(data)

Populates the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md) from the *data* appending the items to the existing items.

| Parameter | Type                                                                | Description                                                                                                         |
| --------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **data**  | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) | The object that contains data for the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md) to display. |

**Returns:** [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32). Numbers of items appended.

Use this method to fill a [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md) without binding it to the data source.

### ![](/files/uCY6T77rh488FWHzpJ6P)Fill(data)

Populates the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md) from the *data* .

| Parameter | Type                                                                | Description                                                                                                         |
| --------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **data**  | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) | The object that contains data for the [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md) to display. |

**Returns:** [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32). Numbers of items added.

Use this method to fill a [ListControl](/api/v3.0/wisej.web/lists-and-grids/listcontrol.md) without binding it to the data source.

### ![](/files/uCY6T77rh488FWHzpJ6P)GetItemIcon(item)

Returns the icon object, either an instance of [Image](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image) or a [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) representing the icon name or URL, of the specified item.

| Parameter | Type                                                                | Description                                                         |
| --------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| **item**  | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) | The object from which to get the icon to display for the list item. |

**Returns:** [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object). If the [IconMember](#iconmember) property is not specified, the value returned by [GetItemIcon](#getitemicon-item) is null. Otherwise, the method returns the object value of the member specified in the [IconMember](#iconmember) property for the object specified in the *item* parameter.

### ![](/files/uCY6T77rh488FWHzpJ6P)GetItemText(item)

Returns the text representation of the specified item.

| Parameter | Type                                                                | Description                                           |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------- |
| **item**  | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) | The object from which to get the contents to display. |

**Returns:** [String](https://docs.microsoft.com/en-us/dotnet/api/system.string). If the [DisplayMember](#displaymember) property is not specified, the value returned by [GetItemText](#getitemtext-item) is the value of the item's ToString method. Otherwise, the method returns the string value of the member specified in the [DisplayMember](#displaymember) property for the object specified in the *item* parameter.

### ![](/files/uCY6T77rh488FWHzpJ6P)GetItemToolTip(item)

Returns the tooltip text related to the object.

| Parameter | Type                                                                | Description                                                                 |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **item**  | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) | The object from which to get the tooltip text to display for the list item. |

**Returns:** [String](https://docs.microsoft.com/en-us/dotnet/api/system.string). If the [ToolTipMember](#tooltipmember) property is not specified, the value returned by [GetItemToolTip](#getitemtooltip-item) is null. Otherwise, the method returns the value of the member specified in the [ToolTipMember](#tooltipmember) property for the object specified in the *item* parameter.

## Events

### ![](/files/uCY6T77rh488FWHzpJ6P)DataSourceChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the [DataSource](#datasource) changes.

### ![](/files/uCY6T77rh488FWHzpJ6P)DisplayMemberChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the [DisplayMember](#displaymember) property changes.

### ![](/files/uCY6T77rh488FWHzpJ6P)Format

[ListControlConvertEventHandler](/api/v3.0/wisej.web/lists-and-grids/listcontrol/wisej.web.listcontrolconverteventhandler.md) Fired when the control is bound to a data value.

### ![](/files/uCY6T77rh488FWHzpJ6P)FormatInfoChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the value of the [FormatInfo](#formatinfo) property changes.

### ![](/files/uCY6T77rh488FWHzpJ6P)FormatStringChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when value of the [FormatString](#formatstring) property changes.

### ![](/files/uCY6T77rh488FWHzpJ6P)FormattingEnabledChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the value of the [FormattingEnabled](#formattingenabled) property changes.

### ![](/files/uCY6T77rh488FWHzpJ6P)IconMemberChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the [IconMember](#iconmember) property changes.

### ![](/files/uCY6T77rh488FWHzpJ6P)ModifiedChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the value of the [Modified](#modified) property has changed.

### ![](/files/uCY6T77rh488FWHzpJ6P)SelectedValueChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the [SelectedValue](#selectedvalue) property changes.

### ![](/files/uCY6T77rh488FWHzpJ6P)ToolTipMemberChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the [ToolTipMember](#tooltipmember) property changes.

### ![](/files/uCY6T77rh488FWHzpJ6P)ValueMemberChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the [ValueMember](#valuemember) property changes.

## Inherited By

| Name                                                                                                                                   | Description                                                                                                                                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CheckedListBox](/api/v3.0/wisej.web/lists-and-grids/checkedlistbox.md)                                                                | Displays a [ListBox](/api/v3.0/wisej.web/lists-and-grids/listbox.md) in which a check box is displayed to the left of each item.                                                                                             |
| [ComboBox](/api/v3.0/wisej.web/lists-and-grids/combobox.md)                                                                            | Represents a combo box control.                                                                                                                                                                                              |
| [ListBox](/api/v3.0/wisej.web/lists-and-grids/listbox.md)                                                                              | Represents a control to display a list of items.                                                                                                                                                                             |
| [DataGridViewComboBoxEditingControl](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcomboboxeditingcontrol.md) | Represents a [ComboBox](/api/v3.0/wisej.web/lists-and-grids/combobox.md) control that can be hosted in a [DataGridViewComboBoxCell](/api/v3.0/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcomboboxcell.md). |
| [ListViewComboBox](/api/v3.0/wisej.web/lists-and-grids/wisej.web.listviewcombobox.md)                                                  | The TreeViewComboBox control represents a [UserComboBox](/api/v3.0/wisej.web/lists-and-grids/wisej.web.usercombobox.md) control with a [ListView](/api/v3.0/wisej.web/lists-and-grids/listview.md) as the drop down panel.   |
| [TreeViewComboBox](/api/v3.0/wisej.web/lists-and-grids/wisej.web.treeviewcombobox.md)                                                  | The TreeViewComboBox control represents a [UserComboBox](/api/v3.0/wisej.web/lists-and-grids/wisej.web.usercombobox.md) control with a [TreeView](/api/v3.0/wisej.web/lists-and-grids/treeview.md) as the drop down panel.   |
| [UserComboBox](/api/v3.0/wisej.web/lists-and-grids/wisej.web.usercombobox.md)                                                          | The UserComboBox control represents a [ComboBox](/api/v3.0/wisej.web/lists-and-grids/combobox.md) control with a custom panel that drops down when the user clicks the down arrow.                                           |

## Implements

| Name                                                                                   | Description                                                                                                                |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [IBindableComponent](/api/v3.0/wisej.web/data-binding/wisej.web.ibindablecomponent.md) | Bindable components implement this interface.                                                                              |
| [IWisejComponent](/api/v3.0/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface.                                                                             |
| [IWisejControl](/api/v3.0/wisej.core/interfaces/wisej.core.iwisejcontrol.md)           | All wisej controls derived from the [Control](/api/v3.0/wisej.web/general/control.md) class must implement this interface. |
| [IWisejSerializable](/api/v3.0/wisej.core/interfaces/wisej.core.iwisejserializable.md) | Allows an object to serialize itself.                                                                                      |


---

# 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/v3.0/wisej.web/lists-and-grids/listcontrol.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.
