DateTimePicker ReadOnly

2 posts, 0 answers
  1. Mark
    Mark avatar
    36 posts
    Member since:
    Jan 2012

    Posted 28 Aug 2017 Link to this post


    I am trying to make a DateTimePicker readonly and having limited success. A forum search returns a ton of candidate workarounds for this, but some of them stretch back to 2009 and it is very difficult to figure out whether these workarounds are still valid, supported, required or optimal with the latest release.

    I am trying to suppress input (either keyboard, mouse, direct input or via the calendar dropdown) for a datetimepicker and the logical approach would seem to be to set the ReadOnly property to true, but this doesn't appear to have any effect.

    The most common approach on the forums (from 2009 onwards) is to set the control to disabled and then fudge the styling to make it match other readonly controls, which is the approach we have taken in the past. However we are currently refactoring our control code with a view to simplifying it by removing any overly complicated hacks and fudges, so ideally this is an approach we are looking to replace.

    Many of the posts recommending this approach are over 8 years old, so I am hoping this has been superseded but I am again struggling to achieve this intuitively with the latest control release.

    Is there a way to set the control to readonly rather than disabled, or is the styling approach still the recommended solution?




  2. Hristo
    Hristo avatar
    1522 posts

    Posted 29 Aug 2017 Link to this post

    Hello Mark,

    Thank you for writing.

    I am testing the latest assemblies and the ReadOnly property set to the control is working well on my end. Please check the attached project and the short video for reference.

    In case you keep experiencing the issue please let me know if I need to setup something else in order to reproduce it.

    I hope this helps. Please let me know if you need further questions.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top