windowsforms-devexpress-dot-xtrabars-dot-barlistitem-dcf038ca.md
Specifies the index of the selected(checked) item in a list.
Namespace : DevExpress.XtraBars
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DefaultValue(-1)]
public virtual int ItemIndex { get; set; }
<DefaultValue(-1)>
Public Overridable Property ItemIndex As Integer
| Type | Default | Description |
|---|---|---|
| Int32 | -1 |
The selected(checked) item index.
|
Use this property to select a specific item in a list at runtime. The default value means that no item is selected. The item index is zero-based.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ItemIndex 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.
}
layoutModeBarItem.ItemIndex = settings.UseGridLayout? 0:1;
}
End If
layoutModeBarItem.ItemIndex = If(settings.UseGridLayout, 0, 1)
End If
See Also