Category / Section
how to customize the DropDownbuttontemplate for DateTimeEdit
1 min read
DropDownButton can be customized by DropDownButtonTemplate of DateTimeEdit with the TargetType as ToggleButton.
The same has been explained in the following code snippet:
XAML:
//Code explains how to customize the DropDownbuttontemplate 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" > <syncfusion:DateTimeEdit.DropDownButtonTemplate> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Grid> <Label Background="Yellow" BorderBrush="Red" BorderThickness="2"> </Label> <Image Source="Drop.png"></Image> </Grid> </ControlTemplate> </syncfusion:DateTimeEdit.DropDownButtonTemplate> </syncfusion:DateTimeEdit> </Grid> </Window>
Output: