Category / Section
How to disable the DateSelection of DateTimeEdit?
1 min read
DateTimeEdit allows to select and change the Date, Month and Year. Date selection can be disable by setting DisableDateSelection property of DateTimeEdit as True.
The same has been explained in the following code snippet:
XAML:
//Code Explains How to Disable the DateSelection in 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="150" Height="80" Text="DateTimeEdit" DisableDateSelection="True"> </syncfusion:DateTimeEdit> </Grid> </Window>
C#:
//Code Explains How to Disable the DateSelection in DateTimeEdit namespace DateTimeEdit_FocusBehaviour { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DateTime.DisableDateSelection = true; } } }
Output: