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

4 posts, 0 answers
  1. SweNz
    SweNz avatar
    18 posts
    Member since:
    Jan 2011

    Posted 13 Jul 2011 Link to this post

    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

  2. Ivo
    Ivo avatar
    390 posts

    Posted 15 Jul 2011 Link to this post

    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,
    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!

  3. DevCraft banner
  4. SweNz
    SweNz avatar
    18 posts
    Member since:
    Jan 2011

    Posted 17 Jul 2011 Link to this post

    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,

  5. Bairong
    Bairong avatar
    1 posts
    Member since:
    Aug 2016

    Posted 11 Aug Link to this post

Back to Top