[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
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Collapse]Scheduler
   [Expand]Getting Started
   [Expand]Appointments
    Resources
    Reminders
   [Expand]Views
   [Expand]Visual Elements
   [Expand]Styles and Templates
   [Expand]Design-Time Features
    Time Zones
   [Expand]Data Binding
    Grouping
    Selecting
    Navigating
    Printing
    End-User Restrictions
   [Collapse]Examples
    [Expand]How to: Create Recurrence in Code
     How to: Display the Integrated Ribbon for the Scheduler
     How to: Create the Scheduler with the DateNavigator
     How to: Bind Scheduler to Data using the Entity Framework Code First Approach
     How to: Customize Editing and Recurrence Dialogs
     How to: Customize the In-Place Editor
     How to: Create Custom Labels and Statuses
     How to: Customize Appointment Appearance
     How to: Determine what Scheduler Element Is Hovered by the Mouse Pointer
     How to: Set Default Values for a New Appointment
     How to: Print a Scheduler Using Reports from a Document Preview Window
    Migration Guidelines
  [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]Gantt 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]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Display the Integrated Ribbon for the Scheduler

This example demonstrates how to display the integrated ribbon for the WPF Scheduler and use the ribbon customization actions to add, modify, or remove ribbon elements.

This tutorial consists of the following sections:

Expanded Create a New Application

  1. Create a new WPF Application project and open the MainWindow.xaml file in the Visual Studio Designer.
  2. Add the SchedulerControl object to your project. You can do this by dragging the SchedulerControl item from the DX.18.2: Scheduling Toolbox tab to the canvas.

  3. Right-click the SchedulerControl object and select Layout | Reset All in the context menu to stretch the SchedulerControl so that it fills the entire window.

Expanded Add the Ribbon to the Scheduler

Set the SchedulerControl.CommandBarStyle property to CommandBarStyle.Ribbon to display the integrated ribbon with all the available scheduler commands.

The following image shows the resulting application:

Expanded Customize the Ribbon UI

Add the following namespace declarations to the MainWindow.xaml file:

To modify the Scheduler's ribbon UI, add the necessary customization actions to the SchedulerControl.RibbonActions collection. The action's ElementName property specifies the name of the existing ribbon element you wish to change or remove. Element names are the DevExpress.Xpf.Scheduling.DefaultBarItemNames class fields. You can deduce the required element's name by following the naming rules listed in the table below:

Ribbon Element

Element Type

Page Name

Group Name

Item Name

DefaultBarItemNames Field

Page/Tab

Pages

Home

Pages_Home

Group

Groups

Home

Appointment

Groups_Home_Appointment

Item

Items

Home

Appointment

NewAppointment

Items_Home_Appointment_NewAppointment

Select the action you wish to perform:

  - Remove a Ribbon Element

  - Modify a Ribbon Element

  - Add a New Ribbon Element

  • Remove a Ribbon Element

    To remove an element from the ribbon, add a RemoveAction with the required element's name to the SchedulerControl.RibbonActions collection.

    The following code demonstrates how to remove a specific ribbon group and item:

    Tip

    A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T544922.

  • Modify a Ribbon Element

    Use an UpdateAction to change an existing ribbon element. Specify the element's name, the property you wish to modify and the new value that should be assigned to this property.

    The example below demonstrates how to disable the Appointment group on the ribbon and hide the Group by Date button.

    Tip

    A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T544922.

  • Add a New Ribbon Element

    To add a new element to the ribbon, add an InsertAction to the SchedulerControl.RibbonActions collection.

    The code below demonstrates how to create a new ribbon button. The About button is located in a separate Example group and uses the BarItem.ItemClick event to display a custom message containing information about the current example.

    Tip

    A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T544922.

    Handle the About button's BarItem.ItemClick event as shown below.

The complete XAML code for the Scheduler with a custom ribbon is shown below:

Expanded Result

Run the application. The following image illustrates the result:

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