[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
    [Collapse]Visual Elements
      Ribbon Page
      Ribbon Page Group
      Categories and Contextual Tabs
      Quick Access Toolbar
      Page Header Items
      Application Button
      Search Menu
    [Expand]Items and 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)

Categories and Contextual Tabs

Contextual tabs are RibbonPage objects that are initially hidden and appear on-screen only under certain conditions. For example, the following figure illustrates two contextual pages ("Format" and "Clipboard"), which are visible only when a user selects a text in a document below.

Expanded Categories

All Ribbon pages belong to categories - instances of the RibbonPageCategory class. Any Ribbon control always has at least one category that can be accessed through the RibbonControl.DefaultPageCategory property. Pages that you add to a Ribbon control will by default belong to this default category (such pages are called unassigned).

In order to create contextual pages, you first need to add custom categories.

Expanded Add Custom Categories

To add a custom category, click a related button at design time.

To do the same in code, create an object of the RibbonPageCategory class and add it to the RibbonControl.PageCategories collection.

An empty category is never shown. To populate a category, select it at design time and click the on-form "Add Page" button.

To make contextual tabs appear in a specific scenario only, disable the RibbonPageCategory.Visible property of these tabs' parent category and re-enable it manually when needed.

Expanded Additional Category Settings

In case your custom category will contain one page only, enable the RibbonPageCategory.AutoStretchPageHeaders property. In this case, the category and the page header widths will match.

To highlight a custom category, use the RibbonPageCategory.Appearance property.

Finally, you can disable the RibbonControl.ShowCategoryInCaption property to hide categories' captions.

Expanded See Also

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