Skip to main content
Bar

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BarListItem.Strings Property

Provides access to a collection that stores items for the current BarListItem object.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Content")]
public virtual BarListStringCollection Strings { get; }

#Property Value

Type Description
DevExpress.XtraBars.BarListStringCollection

Contains items for the current BarListItem object.

#Remarks

A BarListItem object is intended to display a list of strings. Use the Strings property to add items to the BarListItem object.

The following code adds three items to a BarListItem object:

// Adds new list items.
barListItem1.Strings.Add("Item1");
barListItem1.Strings.Add("Item2");
barListItem1.Strings.Add("Item3");

// Gets the first list item.
string firstElement = barListItem1.Strings[0];

private void barListItem1_ListItemClick(object sender, DevExpress.XtraBars.ListItemClickEventArgs e) {
  // Gets the list item clicked by the user.
  string listItem = (e.Item as DevExpress.XtraBars.BarListItem).Strings[e.Index];
}
See Also