BaseListBoxControl.DataSource Property

Gets or sets the data source that provides items to display in the control.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

[DefaultValue(null)]
[DXCategory("Data")]
public virtual object DataSource { get; set; }
<DefaultValue(Nothing)>
<DXCategory("Data")>
Public Overridable Property DataSource As Object

Property Value

Type Default Description
Object

null

A data source object whose data is displayed by the ListBox control.

Remarks

Use the DataSource property to bind the control to a data source and thus display data source records as listbox items. The data source can be any object implementing the IList or IListSource interface. Changing the DataSource property value at runtime raises the BaseListBoxControl.DataSourceChanged event.

The following properties can be additionally customized:

To retrieve listbox items in bound mode, use the BaseListBoxControl.GetItem method.

To populate the ListBox control in unbound mode, add items to the control's Items collection (ListBoxControl.Items, BaseCheckedListBoxControl.Items or BaseImageListBoxControl.Items).

See Also