[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Collapse]Ribbon, Bars and Menu
    [Expand]The Ribbon UI
    [Expand]Visual Elements
    [Collapse]Items and Item Links
      Accessing Bar Items and Links
      Bar Item Behavior Options
      Bar Item Display Options
      Button Groups
      What are Bar Items and Bar Item Links?
     Ribbon Styles
    [Expand]Main Menus
    [Expand]Ribbon Control Designer
    [Expand]Runtime Capabilities
     Known Issues
   [Expand]Popup Menus
    Radial Menu
   [Expand]Common Features
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

What are Bar Items and Bar Item Links?

If you look at a Ribbon Page Group, status bar or Quick Access Toolbar you may see various visual elements (command buttons, static text, editors, menus, galleries, etc), each of which provides specific functionality.

If you need to add a command button, editor, static text or any other element to a bar, status bar, menu or Ribbon Control you need to create a specific bar item. Bar items provide multiple display and behavior options that can be customized: the caption, large and small images, events that occur when the corresponding elements are clicked, etc. For instance, to add a regular button to a bar you need to create a BarButtonItem object. Its Caption and Glyph properties allow you to assign text and image to the button. The item's ItemClick event allows you to implement the button's functionality. Note, however, that bar items are non-visual components.

All the visual elements (command buttons, editors, submenus, static text, etc) displayed within bars and the Ribbon Control are bar item links. A bar item link refers to a specific bar item, so it has all the necessary information to draw itself onscreen. In XtraBars, you can create multiple links to the same bar item and display them in different places. For instance, you can display links that refer to the same BarButtonItem on the Quick Access Toolbar and on a RibbonPage at the same time. Clicking on either of them will invoke the same event handler which is assigned to the BarButtonItem's ItemClick event.

The DevExpress Ribbon, Menu and Docking Library provides multiple bar items that can be used to add various elements to the RibbonControl. For instance, a BarButtonItem object allows you to add a button, while a BarSubItem object is used to add a submenu, etc. For a complete list of bar items, see The List of Bar Items and Links.

Generally, there is no need to create bar item links manually. Instead, you need to create a specific bar item and add it to a Ribbon Page or bar. When a bar item is added to a Ribbon Page or bar, a link to this item is automatically created and added to the Ribbon Page/bar.


If you create Bar Items in code, note that these objects may not function properly without being associated with a BarManager or RibbonControl. To create a Bar Item, use a Bar Item constructor that has the BarManager parameter. When creating a Bar Item in code for use within a RibbonControl, use a Bar Item constructor that has the BarManager parameter, and pass the RibbonControl.Manager object as this parameter.

Is this topic helpful?​​​​​​​