Articles in this section
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:

C:\Users\Ashok.Murugesan\Desktop\KBTask\13.4SprintKBTools\ScreenShot\Datetime-UpDown.png

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied