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
    [Collapse]Visual Elements
      Ribbon Page
      Ribbon Page Group
      Categories and Contextual Tabs
      Quick Access Toolbar
      Page Header Items
      Application Button
    [Expand]Items and 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]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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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 and its child tabs, use the RibbonPageCategory.Color property. This custom color will blend with the underlying color of the Ribbon client area, so this setting is most noticeable in light DevExpress skins.

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

Expanded See Also

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