This is a migrated thread and some comments may be shown as answers.

Disable input field (force user choose date by click on calendar)

3 Answers 187 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
SweNz
Top achievements
Rank 1
SweNz asked on 13 Jul 2011, 06:46 PM
Hi telerik,

I have 2 raddatepicker which are STARTDATE and ENDDATE. My business logic constraint is START DATE must less or equal to END DATE. Now, I'm using SelectableDateStart and SelectableDateEnd property to validate selected date and it works fine. My problem is this method can't handle if user input Date by key-in.

How to disable "Key-in" function ?

My XAML :
<telerik:RadDatePicker x:Name="startDate" SelectableDateEnd="{Binding ElementName=endDate, Path=SelectedDate }" />
  
<telerik:RadDatePicker x:Name="endDate" SelectableDateStart="{Binding ElementName=startDate, Path=SelectedDate }" />

Please give me some advice , thank you

SweNz

3 Answers, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 15 Jul 2011, 01:33 PM
Hello Swenz,

The easiest way to achieve this is to open RadDateTimePicker in Blend and customize it. The only thing you will have to change is telerik:RadWatermarkTextBox's isReadOnly property to true. I have attached a sample example to demonstrate you this.

The other way to accomplish your needs is to write validation code on SelectionChanged. If you chose this one you will have to write some code, but it will be more flexible.

Hope this helps.

Best wishes,
Ivo
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
SweNz
Top achievements
Rank 1
answered on 17 Jul 2011, 06:19 PM
Hi Ivo,

Thank you for your response. I tested your sample project and it works.But it's really hard to understand in short time then I changed my old RadDatePicker to RadDateTimePicker  and set IsReadOnly = True .. It doesn't work. It's ok...

I'll try to figure out later :))

Best regards,

SweNz
0
Bairong
Top achievements
Rank 1
answered on 11 Aug 2016, 08:39 PM
DateInput-ReadOnly="true"
Tags
DatePicker
Asked by
SweNz
Top achievements
Rank 1
Answers by
Ivo
Telerik team
SweNz
Top achievements
Rank 1
Bairong
Top achievements
Rank 1
Share this question
or