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

Time Picker in DateTimePicker do not affect ReadOnly property

2 Answers 195 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Zan
Top achievements
Rank 1
Zan asked on 27 Nov 2017, 05:06 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 27 Nov 2017, 02:10 PM
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.
0
Zan
Top achievements
Rank 1
answered on 28 Nov 2017, 03:00 AM

Thank Hristo, your solution is helpful.

Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Zan
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Zan
Top achievements
Rank 1
Share this question
or