This is a migrated thread and some comments may be shown as answers.

DateTimePicker ReadOnly

1 Answer 148 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 28 Aug 2017, 10:36 AM

Hi,

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?

Thanks,

Mark.

 

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 29 Aug 2017, 08:39 AM
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.

Regards,
Hristo
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.
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Mark
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or