How do I not allow user to type into control but select date from control?

4 posts, 0 answers
  1. Anthony Pieper
    Anthony Pieper avatar
    8 posts
    Member since:
    Jul 2009

    Posted 21 Jul 2009 Link to this post

    I am currently setting the IsReadOnly property to true and this doesn't allow the user to type into the control, which is good, however it is not allowing the user to select a date within the control.

    I want to limit the user to only select dates on the calendar AND not be able to type in a date.

    Is there a property or properties to set to allow this behavior?

  2. Boyan
    Boyan avatar
    758 posts

    Posted 23 Jul 2009 Link to this post

    Hi Anthony Pieper,

    This one is intended. However you can achieve the wanted scenario by editing the Control Template. Just edit in Blend and then find the where is the Calendar style and remove the IsReadOnly binding. In such way only the textbox will become ReadOnly and not the calendar.
    I have attached a sample project . If you need more help please let me know.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Aeroth
    Aeroth avatar
    17 posts
    Member since:
    Oct 2010

    Posted 06 Oct 2010 Link to this post

    How do I achieve this programmatically because my DatePickers are created dynamically. There's no xaml file to edit...
    Thanks !
  4. Kaloyan
    Kaloyan avatar
    920 posts

    Posted 06 Oct 2010 Link to this post

    Hi Aeroth,

    Put the style of the control as a resources in your app.xaml. Then in the declaration of the datepicker set the style as:

    var radDatePicekr = new RadDatePicker { Style = this.Resources["RadDatePickerStyle1"] };

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top