Skip to main content

BaseListBoxControl.GetDisplayItemValue(Int32) Method

Gets an item’s display value.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public object GetDisplayItemValue(
    int index
)

Parameters

Name Type Description
index Int32

A zero-based integer specifying the item by its position within the collection.

Returns

Type Description
Object

An object representing the item’s value. The String.Empty value if the item index provided is invalid.

Remarks

This method’s return value is an object whose textual representation is the specified item’s display text.

If a list box control displays data field values, the GetDisplayItemValue method returns this field’s value in the specified record. Note: you should use the BaseListBoxControl.DataSource and BaseListBoxControl.DisplayMember properties to bind the list box to a data source and to specify the field supplying display values.

When using a ListBoxControl control, the GetDisplayItemValue method returns an element of the ListBoxControl.Items collection. If using a CheckedListBoxControl or ImageListBoxControl control, the GetDisplayItemValue method returns the ComboBoxItem.Value property of the specified list box item.

If you need to obtain the item’s display text, call the BaseListBoxControl.GetItemText method instead.

See Also