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

 

C:\Users\Ashok.Murugesan\Desktop\KBTask\13.4SprintKBTools\ScreenShot\DateTime-DisableDateSelection.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