Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Bars
   [Collapse]Ribbon
    [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]Galleries
    [Expand]Main Menus
    [Expand]Ribbon Control Designer
    [Expand]Runtime Capabilities
    [Expand]Miscellaneous
     Known Issues
   [Expand]Popup Menus
    Radial Menu
   [Expand]Common Features
   [Expand]Examples
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap 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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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.

Note

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.

How would you rate this topic?​​​​​​​