Skip to main content

BaseListBoxControl.GetItemValue(Int32) Method

Gets the specified item’s value.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public object GetItemValue(
    int index
)

Parameters

Name Type Description
index Int32

An integer value representing the zero-based index of the item whose value is returned.

Returns

Type Description
Object

An object representing the specifyed item’s value. null (Nothing in Visual Basic) if no item is found.

Remarks

When no data source is bound to a control, this method returns the value of the item whose index is specified by the parameter. Otherwise, an object representing the contents of the data source field whose name is specified by the BaseListBoxControl.ValueMember property is returned. If this property is not specified, the entire item (a record at the specified position within a data source) is returned.

If you need to get the value of a currently selected item, use the BaseListBoxControl.SelectedValue property. The item’s display text can be obtained via the BaseListBoxControl.GetItemText method.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetItemValue(Int32) method.

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