[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Collapse]Ribbon, Bars and Menu
   [Expand]Common Features
   [Expand]Bars
   [Collapse]Ribbon
    [Expand]Overview
    [Collapse]Ribbon Structure
      Ribbon Control
      Ribbon Page Categories and Contextual Pages
      Ribbon Page
      Ribbon Page Group
      Ribbon Quick Access Toolbar
      Ribbon Status Bar
      DXRibbonWindow
    [Expand]Populating Ribbon
    [Expand]Ribbon Menu
    [Expand]Features
     Runtime Customization
    [Expand]Examples
   [Expand]Menus
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Ribbon Page Categories and Contextual Pages

The Ribbon Control consists of page categories which own ribbon pages. Each page within the RibbonControl belongs to a specific page category - either the default or a custom category. The page's category affects how the page is represented on screen.

Pages that belong to the default category are considered main pages of a Ribbon application, while pages that belong to custom categories should provide context specific information. Use custom categories to implement contextual pages, as in the Microsoft Office UI. This topic provides more information.

Expanded Default Page Category

The RibbonControl must always contain a single category, called default. It's represented by the RibbonDefaultPageCategory class. Unlike custom categories, the default category's caption is never displayed on screen. Pages that belong to the default category can be thought of as main, context independent tabs. Although these pages can be temporarily hidden when required, in most instances an application is designed so that these pages are permanently visible during the application run.

The following image shows a RibbonControl with two pages (Home and Gallery Page) belonging to the default category.

To define a default category, create a RibbonDefaultPageCategory object and add it to the RibbonControl's Items collection. Pages can then be added to the category's RibbonPageCategoryBase.Pages collection. In XAML, they can be directly added between the RibbonDefaultPageCategory start and end tags.

For each page, you can access the parent category via the RibbonPage.PageCategory property. For the default category, the RibbonPageCategoryBase.IsDefault property returns true. For custom categories, this property returns false.

Expanded Custom Page Categories and Contextual Tabs

The RibbonControl allows contextual tab pages to be implemented, as in the Microsoft Office UI. These pages are designed to display context specific commands, so they don't need to be constantly displayed, but displayed only when a particular object is selected, or an end-user performs a certain action.

To implement contextual tab pages, create a custom page category (RibbonPageCategory), add it to the RibbonControl's Items collection, and then add ribbon pages to the category. Unlike the default page category, captions of custom categories are visible and specifically colored. The following image shows a RibbonControl with a custom Selection page category containing a Selection tab page.

When contextual tab pages are made visible, they are displayed to the right of the default tab pages (they can also be optionally anchored at the right edge of the RibbonControl via the RibbonControl.PageCategoryAlignment property). Above their captions, a corresponding category's caption (RibbonPageCategoryBase.Caption) is displayed. With the RibbonControl, you can display multiple page categories simultaneously, and each can contain one or more contextual tabs.

Custom page categories with contextual pages should be displayed dynamically, according to your requirements (for instance, when a specific object is selected). So, their visibility status must be controlled manually. To hide and display page categories and contextual pages, use the RibbonPageCategoryBase.IsVisible and RibbonPage.IsVisible properties. Typically, only a category's visibility should be changed, as this automatically affects the visibility status of all pages that belong to this category.

To activate/select a specific page, use the RibbonPage.IsSelected or RibbonControl.SelectedPage property.

Expanded Appearances of Categories and Contextual Tabs

Custom categories and their pages are painted slightly differently than default pages. It's possible to explicitly specify the background color for custom categories and pages via the RibbonPageCategoryBase.Color property. This color is mixed with the control's background when captions of page categories and pages are rendered.

By default, custom categories are displayed to the right of the default Ribbon pages. The RibbonControl.PageCategoryAlignment property allows these to be anchored to the right edge of the RibbonControl.

Expanded Examples

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