Reputation: 1
I have XamDateTimeEditor
control in the XAML(code given below). Currently the user is able to type in the date or select from the calender dropdown. But I don't want the XamDateTimeEditor
to allow any users to type in any date through keyboard, it should only be done by the dropdown using mouse.
here is the code in XAML -
<igEditors:XamDateTimeEditor x:Name="xamDateTimeEditorEntryDate"
AutoFillDate="MonthAndYear"
IsAlwaysInEditMode="True"
Mask="mm/dd/yyyy"
Text="{Binding EntryDate,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}" />
Upvotes: 0
Views: 1482
Reputation: 241
You can handle the XamDateTimeEditor's PreviewKeyDownEvent and set the e.Handled Proprty to true in the event handler. This way the user won't be able to enter anything using the Keyboard.
Upvotes: 1