Category / Section
How to Customize the RepeatButton for DateTimeEdit?
1 min read
RepeatButton can be customized by UpRepeatButtonTemplate and
DownRepeatButtonTemplate of DateTimeEdit with TargetType as RepeatButton.
The same has been explained in the following code snippet:
XAML:
//Code explains how to Customize the RepeatButton for DateTimeEdit: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="DateTimeEdit_FocusBehaviour.MainWindow" Title="MainWindow" Height="350" Width="525"> <Grid> <syncfusion:DateTimeEdit Name="DateTime" Width="180" HorizontalAlignment="Center" Height="60" Text="DateTimeEdit" IsVisibleRepeatButton="True"> <syncfusion:DateTimeEdit.UpRepeatButtonTemplate> <ControlTemplate TargetType="{x:Type RepeatButton}"> <TextBlock Text="UP" Background="Green" FontSize="10" > </TextBlock> </ControlTemplate> </syncfusion:DateTimeEdit.UpRepeatButtonTemplate> <syncfusion:DateTimeEdit.DownRepeatButtonTemplate> <ControlTemplate TargetType="{x:Type RepeatButton}"> <TextBlock Text="DOWN" Background="Red" FontSize="10"> </TextBlock> </ControlTemplate> </syncfusion:DateTimeEdit.DownRepeatButtonTemplate> </syncfusion:DateTimeEdit> </Grid> </Window>
Output: