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

How to make RadTimePicker to parse input string from code

2 Answers 93 Views
TimePicker
This is a migrated thread and some comments may be shown as answers.
Alexus
Top achievements
Rank 1
Alexus asked on 21 Jan 2013, 10:23 AM
Hello.
Question is "How to tell RadTimePicker to parse input text from CurrentDateTimeText property and refresh SelectedTime property by parsed value".

Background:
My control consists from RadTimePicker and two buttons - accept and cancel.
It works but there is an issue.
If user input "1234" to the picker an then press accept button without pressing enter - there is old value in  SelectedTime property (but  CurrentDateTimeText contains user`s input). 

Thanks.

2 Answers, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 24 Jan 2013, 08:37 AM
Hi Alex,

Setting the RadTimePicker's DateTimeText property will force an update of the SelectedValue. Here is sample code:
this.RadTimePicker.DateTimeText = this.RadTimePicker.CurrentDateTimeText;

Call this on the Accept button and everything should work as expected.

Kind regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Alexus
Top achievements
Rank 1
answered on 29 Jan 2013, 05:23 AM
This is exactly what I need.

Frankly, I have extracted this code from controls with decompiler day earlier ;)

Anyway, thanks a lot for reply!
Tags
TimePicker
Asked by
Alexus
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Alexus
Top achievements
Rank 1
Share this question
or