ListControl

Wisej.Web.ListControl

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.0.0.0)

Provides a common implementation of members for the ListBox and ComboBox classes.

public class ListControl : Control, IValidation, IModified

Properties

AllowHtml

Boolean: Returns or sets a value indicating that the control can display HTML in the Text property. (Default: False)

AllowSelection

Boolean: Returns a value indicating whether the list enables selection of list items.

BorderStyle

BorderStyle: Returns or sets the type of border that is drawn around the ListControl. (Default: Solid)

DataSource

Object: Returns or sets the data source for this ListControl. (Default: null)

Throws:

DisplayMember

String: Returns or sets the property to display for this ListControl. (Default: "")

FormatInfo

IFormatProvider: Returns or sets the IFormatProvider that provides custom formatting behavior. (Default: null)

FormatString

String: Returns or sets the format-specifier characters that indicate how a value is to be displayed. (Default: "")

FormattingEnabled

Boolean: Returns or sets whether formatting is applied to the DisplayMember property of the ListControl. (Default: False)

IconMember

String: Returns or sets the property to use as the icon for the items in the ListControl. (Default: "")

Invalid

Boolean: Returns or sets a value that indicates that the control is invalid.

InvalidMessage

String: Returns or sets the invalid message that is shown in the invalid tooltip. (Default: "")

Modified

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.

PrefetchItems

Int32: Returns or sets the number of items to prefetch outside of the visible area when VirtualScroll is set to true. The default is 0 (disabled). (Default: 0)

SelectedIndex

Int32: When overridden in a derived class, gets or sets the zero-based index of the currently selected item.

SelectedValue

Object: Returns or sets the value of the member property specified by the ValueMember property. (Default: null)

Throws:

ShowToolTips

Boolean: Returns or sets whether to show tooltips (set using ToolTipMember) for the list items. (Default: False)

ToolTipMember

String: Returns or sets the property to use as the tooltip for the items in the ListControl, when the property ShowToolTips is set to true. (Default: "")

ValueMember

String: Returns or sets the property to use as the actual value for the items in the ListControl. (Default: "")

Throws:

VirtualScroll

Boolean: Enables or disables virtual scrolling for the ListControl. When virtual scrolling is enabled, only the visible items are rendered in the browser allowing the ListControl to host virtually unlimited items without any performance loss. (Default: False)

When VirtualScroll is set to true, all the items must be of the same height, limiting the more flexible HTML rendering available when VirtualScroll is off (default). Setting the property 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.Throws:

Methods

Append(data)

Populates the ListControl from the data appending the items to the existing items.

Parameter
Type
Description

data

The object that contains data for the ListControl to display.

Returns: Int32. Numbers of items appended.

Use this method to fill a ListControl without binding it to the data source.

Dispose(disposing)

Dispose the control.

Parameter
Type
Description

disposing

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

Fill(data)

Populates the ListControl from the data .

Parameter
Type
Description

data

The object that contains data for the ListControl to display.

Returns: Int32. Numbers of items added.

Use this method to fill a ListControl without binding it to the data source.

FilterItemOnProperty(item)

Retrieves the current value of the ListControl item, if it is a property of an object, given the item.

Parameter
Type
Description

item

The object the ListControl item is bound to.

Returns: Object. The filtered object.

FilterItemOnProperty(item, field)

Returns the current value of the ListControl item, if it is a property of an object given the item and the property name.

Parameter
Type
Description

item

The object the ListControl item is bound to.

field

The property name of the item the ListControl is bound to.

Returns: Object. The filtered object.

GetItemIcon(item)

Returns the icon object, either an instance of Image or a String representing the icon name or URL, of the specified item.

Parameter
Type
Description

item

The object from which to get the icon to display for the list item.

Returns: Object. If the IconMember property is not specified, the value returned by GetItemIcon is null. Otherwise, the method returns the object value of the member specified in the IconMember property for the object specified in the item parameter.

GetItemText(item)

Returns the text representation of the specified item.

Parameter
Type
Description

item

The object from which to get the contents to display.

Returns: String. If the DisplayMember property is not specified, the value returned by GetItemText is the value of the item's ToString method. Otherwise, the method returns the string value of the member specified in the DisplayMember property for the object specified in the item parameter.

GetItemToolTip(item)

Returns the tooltip text related to the object.

Parameter
Type
Description

item

The object from which to get the tooltip text to display for the list item.

Returns: String. If the ToolTipMember property is not specified, the value returned by GetItemToolTip is null. Otherwise, the method returns the value of the member specified in the ToolTipMember property for the object specified in the item parameter.

IsInputKey(keyData)

Handles special input keys, such as PAGE UP, PAGE DOWN, HOME, END, and so on.

Parameter
Type
Description

keyData

One of the values of Keys.

Returns: Boolean. true if the keyData parameter specifies the End, Home, PageUp, or PageDown key; false if the keyData parameter specifies Alt.

OnBindingContextChanged(e)

Fires the BindingContextChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnDataSourceChanged(e)

Fires the DataSourceChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnDisplayMemberChanged(e)

Fires the DisplayMemberChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnFormat(e)

Raises the Format event.

Parameter
Type
Description

OnFormatInfoChanged(e)

Fires the FormatInfoChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnFormatStringChanged(e)

Fires the FormatStringChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnFormattingEnabledChanged(e)

Fires the FormattingEnabledChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnIconMemberChanged(e)

Fires the IconMemberChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnModifiedChanged(e)

Fires the ModifiedChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnSelectedIndexChanged(e)

Fires the SelectedValueChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnSelectedValueChanged(e)

Fires the SelectedValueChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnToolTipMemberChanged(e)

Fires the ToolTipMemberChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnValidating(e)

Fires the Validating event.

Parameter
Type
Description

e

A CancelEventArgs that contains the event data.

OnValueMemberChanged(e)

Fires the ValueMemberChanged event.

Parameter
Type
Description

e

A EventArgs that contains the event data.

OnWebRender(config)

Renders the client component.

Parameter
Type
Description

config

Dynamic configuration object.

RefreshItem(index)

When overridden in a derived class, resynchronizes the data of the object at the specified index with the contents of the data source.

Parameter
Type
Description

index

The zero-based index of the item whose data to refresh.

RefreshItems()

When overridden in a derived class, resynchronizes the item data with the contents of the data source.

RenderItem(item)

Renders the text representation of the specified item. If AllowHtml is set to false, the text is encoded.

Parameter
Type
Description

item

The object from which to get the contents to display.

Returns: Object. If the DisplayMember property is not specified, the value returned by GetItemText is the value of the item's ToString method. Otherwise, the method returns the string value of the member specified in the DisplayMember property for the object specified in the item parameter.

SetItemCore(index, value)

When overridden in a derived class, sets the object with the specified index in the derived class.

Parameter
Type
Description

index

The array index of the object.

value

The object.

SetItemsCore(items)

When overridden in a derived class, sets the specified array of objects in a collection in the derived class.

Parameter
Type
Description

items

An array of items.

Events

DataSourceChanged

EventHandler Fired when the DataSource changes.

DisplayMemberChanged

EventHandler Fired when the DisplayMember property changes.

Format

ListControlConvertEventHandler Fired when the control is bound to a data value.

FormatInfoChanged

EventHandler Fired when the value of the FormatInfo property changes.

FormatStringChanged

EventHandler Fired when value of the FormatString property changes.

FormattingEnabledChanged

EventHandler Fired when the value of the FormattingEnabled property changes.

IconMemberChanged

EventHandler Fired when the IconMember property changes.

ModifiedChanged

EventHandler Fired when the value of the Modified property has changed.

SelectedValueChanged

EventHandler Fired when the SelectedValue property changes.

ToolTipMemberChanged

EventHandler Fired when the ToolTipMember property changes.

ValueMemberChanged

EventHandler Fired when the ValueMember property changes.

Inherited By

Name
Description

Displays a ListBox in which a check box is displayed to the left of each item.

Represents a combo box control.

Represents a control to display a list of items.

Represents a ComboBox control that can be hosted in a DataGridViewComboBoxCell.

The TreeViewComboBox control represents a UserComboBox control with a ListView as the drop down panel.

The TreeViewComboBox control represents a UserComboBox control with a TreeView as the drop down panel.

The UserComboBox control represents a ComboBox control with a custom panel that drops down when the user clicks the down arrow.

Implements

Name
Description

Provides access to the UserData and Tag properties associated to the component implementing this interface.

Bindable components implement this interface.

Controls that support drag & drop operations implement this interface.

Provides access to the Modified property and ModifiedChanged event for controls that implement this interface.

Provides access to the validation events and properties property for controls that support validation.

All wisej components implement this interface.

All wisej controls derived from the Control class must implement this interface.

Allows an object to serialize itself.

Last updated

Was this helpful?