Skip to main content
Version: 4.1

ListControl

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

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

public abstract class ListControl : Control, IValidation, IModified

Properties​

Instance member AllowHtml​

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

Protected member AllowSelection​

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

Value: true if the list enables list item selection; otherwise, false. The default is true.

Instance member BorderStyle​

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

Value: One of the BorderStyle values. The default is Solid.

Instance member DataSource​

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

Value: An object that implements the IList or IListSource interfaces, such as a DataSet or an Array. The default is null.

Throws:

Instance member DisplayMember​

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

Value: A String specifying the name of an object property that is contained in the collection specified by the DataSource property. The default is an empty string ("").

Instance member FormatInfo​

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

Value: The IFormatProvider implementation that provides custom formatting behavior.

Instance member FormatString​

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

Value: The string of format-specifier characters that indicates how a value is to be displayed.

Instance member FormattingEnabled​

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

Value: true if formatting of the DisplayMember property is enabled; otherwise, false. The default is false.

Instance member IconMember​

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

Value: A String specifying the name of an object property that is contained in the collection specified by the DataSource property. The default is an empty string ("").

Instance member Invalid​

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

Instance member InvalidMessage​

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

Value: The text displayed in the invalid tooltip.

Instance member 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.

Value: true if the control's contents have been modified; otherwise, false. The default is false.

Instance member 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)

Instance member SelectedIndex​

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

Value: A zero-based index of the currently selected item. A value of negative one (-1) is returned if no item is selected.

Instance member SelectedValue​

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

Value: An object containing the value of the member of the data source specified by the ValueMember property.

Throws:

Instance member ShowToolTips​

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

Value: true if ToolTips are shown for the items that have them; otherwise, false. The default is false.

Instance member 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: "")

Value: A String specifying the name of an object property that is contained in the collection specified by the DataSource property. The default is an empty string ("").

Instance member ValueMember​

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

Value: A String representing the name of an object property that is contained in the collection specified by the DataSource property. The default is an empty string ("").

Throws:

Instance member 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​

Instance member Append(data)​

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

ParameterTypeDescription
dataObjectThe 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.

Protected member Dispose(disposing)​

Dispose the control.

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

Instance member Fill(data)​

Populates the ListControl from the data .

ParameterTypeDescription
dataObjectThe 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.

Protected member FilterItemOnProperty(item)​

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

ParameterTypeDescription
itemObjectThe object the ListControl item is bound to.

Returns: Object. The filtered object.

Protected member 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.

ParameterTypeDescription
itemObjectThe object the ListControl item is bound to.
fieldStringThe property name of the item the ListControl is bound to.

Returns: Object. The filtered object.

Instance member GetItemIcon(item)​

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

ParameterTypeDescription
itemObjectThe 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.

Instance member GetItemText(item)​

Returns the text representation of the specified item.

ParameterTypeDescription
itemObjectThe 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.

Instance member GetItemToolTip(item)​

Returns the tooltip text related to the object.

ParameterTypeDescription
itemObjectThe 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.

Instance member GetItemValue(item)​

Returns the value of the member property specified by the ValueMember property.

ParameterTypeDescription
itemObjectThe object from which to get the value of the list item.

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

Protected member IsInputKey(keyData)​

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

ParameterTypeDescription
keyDataKeysOne 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.

Protected member OnBindingContextChanged(e)​

Fires the BindingContextChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnDataSourceChanged(e)​

Fires the DataSourceChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnDisplayMemberChanged(e)​

Fires the DisplayMemberChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnFormat(e)​

Raises the Format event.

ParameterTypeDescription
eListControlConvertEventArgsA ListControlConvertEventArgs that contains the event data.

Protected member OnFormatInfoChanged(e)​

Fires the FormatInfoChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnFormatStringChanged(e)​

Fires the FormatStringChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnFormattingEnabledChanged(e)​

Fires the FormattingEnabledChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnIconMemberChanged(e)​

Fires the IconMemberChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnModifiedChanged(e)​

Fires the ModifiedChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnSelectedIndexChanged(e)​

Fires the SelectedValueChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnSelectedValueChanged(e)​

Fires the SelectedValueChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnToolTipMemberChanged(e)​

Fires the ToolTipMemberChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnValidating(e)​

Fires the Validating event.

ParameterTypeDescription
eCancelEventArgsA CancelEventArgs that contains the event data.

Protected member OnValueMemberChanged(e)​

Fires the ValueMemberChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnWebRender(config)​

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Protected member 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.

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

Protected member RefreshItems()​

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

Protected member RenderItem(item)​

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

ParameterTypeDescription
itemObjectThe 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.

Protected member SetItemCore(index, value)​

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

ParameterTypeDescription
indexInt32The array index of the object.
valueObjectThe object.

Protected member SetItemsCore(items)​

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

ParameterTypeDescription
itemsIListAn array of items.

Events​

Instance member DataSourceChanged​

EventHandler Fired when the DataSource changes.

Instance member DisplayMemberChanged​

EventHandler Fired when the DisplayMember property changes.

Instance member Format​

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

Instance member FormatInfoChanged​

EventHandler Fired when the value of the FormatInfo property changes.

Instance member FormatStringChanged​

EventHandler Fired when value of the FormatString property changes.

Instance member FormattingEnabledChanged​

EventHandler Fired when the value of the FormattingEnabled property changes.

Instance member IconMemberChanged​

EventHandler Fired when the IconMember property changes.

Instance member ModifiedChanged​

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

Instance member SelectedValueChanged​

EventHandler Fired when the SelectedValue property changes.

Instance member ToolTipMemberChanged​

EventHandler Fired when the ToolTipMember property changes.

Instance member ValueMemberChanged​

EventHandler Fired when the ValueMember property changes.

Inherited By​

NameDescription
CheckedListBoxDisplays a ListBox in which a check box is displayed to the left of each item.
ComboBoxRepresents a combo box control.
ListBoxRepresents a control to display a list of items.
DataGridViewComboBoxEditingControlRepresents a ComboBox control that can be hosted in a DataGridViewComboBoxCell.
ListViewComboBoxThe TreeViewComboBox control represents a UserComboBox control with a ListView as the drop down panel.
TreeViewComboBoxThe TreeViewComboBox control represents a UserComboBox control with a TreeView as the drop down panel.
UserComboBoxThe UserComboBox control represents a ComboBox control with a custom panel that drops down when the user clicks the down arrow.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IModifiedProvides access to the Modified property and ModifiedChanged event for controls that implement this interface.
IValidationProvides access to the validation events and properties property for controls that support validation.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.