New to Telerik UI for WPF? Download free 30-day trial

How to replace the default ContextMenu with RadContextMenu in RadDateTimePicker


Product RadDateTimePicker for WPF


How to replace the default ContextMenu with RadContextMenu in RadDateTimePicker.


  1. Add the RadContextMenu as a StaticResource in xaml.
  2. Handle the Loaded event of the RadDateTimePicker.
  3. In the Loaded event, use the ChildrenOfType method to find the RadWatermarkTextBox inside the RadDateTimePicker and set its ContextMenu property to null.
  4. Set the RadContextMenu to the RadWatermarkTextBox using the RadContextMenu.SetContextMenu() method.

<Grid x:Name="grid"> 
        <telerik:RadContextMenu x:Key="ContextMenu"> 
            <telerik:RadMenuItem Command="ApplicationCommands.Cut" /> 
            <telerik:RadMenuItem Command="ApplicationCommands.Copy"  /> 
            <telerik:RadMenuItem Command="ApplicationCommands.Paste" /> 
    <telerik:RadDateTimePicker  Width="200" Height="25" Foreground="Green" Loaded="RadDateTimePicker_Loaded" />  

public partial class MainWindow : Window 
    public MainWindow() 
    private void RadDateTimePicker_Loaded(object sender, RoutedEventArgs e) 
        var waterMarkTextBox = (sender as RadDateTimePicker).ChildrenOfType<RadWatermarkTextBox>().FirstOrDefault(); 
        waterMarkTextBox.ContextMenu = null; 
        var contextMenu = this.grid.FindResource("ContextMenu") as RadContextMenu; 
        RadContextMenu.SetContextMenu(waterMarkTextBox, contextMenu); 

As an alternative approach, you can also Edit the ControlTemplate of the RadDateTimePicker.

In this article