Time Picker in DateTimePicker do not affect ReadOnly property

3 posts, 1 answers
  1. Zan
    Zan avatar
    19 posts
    Member since:
    Feb 2017

    Posted 26 Nov 2017 Link to this post

    Hello Telerik Team,

    I'm using DateTimePicker as follow,

    radDateTimePicker1.DateTimePickerElement.ShowTimePicker = true;
    radDateTimePicker1.Format = DateTimePickerFormat.Custom;
    radDateTimePicker1.DateTimePickerElement.CalendarSize = new Size(330, 250);
    radDateTimePicker1.ReadOnly = true;

     

    Time value in EditBox cannot edit. ReadOnly property working ok.

    But Time value can be changed from dropdown's picker.

    How can I fix this issue.

  2. Answer
    Hristo
    Admin
    Hristo avatar
    1517 posts

    Posted 27 Nov 2017 Link to this post

    Hi AungKo,

    Thank you for writing.

    Indeed the reported behavior can be considered an issue and I have logged it on our feedback portal, here: FIX. RadDateTimePicker - setting the ReadOnly property on the control is not reflected in the time picker if it is shown by setting the ShowTimePicker property to true. I have updated your Telerik points for the report. Additionally, you can subscribe to the item and be updated with all of its status changes. 

    We will do our best to include the fix in the R1 2018 release. Until then you can use the workaround below: 
    this.radDateTimePicker1.DateTimePickerElement.ShowTimePicker = true;
    this.radDateTimePicker1.Format = DateTimePickerFormat.Custom;
    this.radDateTimePicker1.DateTimePickerElement.CalendarSize = new Size(330, 250);
    this.radDateTimePicker1.ReadOnly = true;
     
    RadDateTimePickerCalendar calendarBehavior = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar;
    calendarBehavior.TimePicker.TimePickerElement.ReadOnly = true;

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Zan
    Zan avatar
    19 posts
    Member since:
    Feb 2017

    Posted 27 Nov 2017 Link to this post

    Thank Hristo, your solution is helpful.

Back to Top