Category / Section
How to change the visibility of dropdown button in DateTimeEdit?
1 min read
Dropdown Button visibility in DateTimeEdit can be changed by setting IsButtonPopUpEnabled property of DateTimeEdit as false.
The same has been explained in the following code snippet:
XAML:
//Code explains how to disable the dropdown button 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="129" IsButtonPopUpEnabled="False " HorizontalAlignment="Center" Height="60" Text="DateTimeEdit"> </syncfusion:DateTimeEdit> </Grid> </Window>
C#:
//Code explains how to disable the dropdown button for DateTimeEdit namespace DateTimeEdit_FocusBehaviour { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DateTime.IsButtonPopUpEnabled = false; } } }
Output: