Skip to main content
A newer version of this page is available. .

BaseListBoxControl.DataSource Property

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

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[DefaultValue(null)]
[DXCategory("Data")]
public virtual object DataSource { get; set; }

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).

The following code snippets (auto-collected from DevExpress Examples) contain references to the DataSource property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also