Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DatePicker > Disable input field (force user choose date by click on calendar)

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

Feed from this thread
  • SweNz avatar

    Posted on Jul 13, 2011 (permalink)

    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

    Reply

  • Ivo Ivo admin's avatar

    Posted on Jul 15, 2011 (permalink)

    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!

    Attached files

    Reply

  • SweNz avatar

    Posted on Jul 17, 2011 (permalink)

    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DatePicker > Disable input field (force user choose date by click on calendar)
Related resources for "Disable input field (force user choose date by click on calendar)"

WPF DatePicker Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]