This is a migrated thread and some comments may be shown as answers.
Set RadComboBox value base on RadTimePicker
1 Answer 22 Views
This is a migrated thread and some comments may be shown as answers.
Jesus
Top achievements
Rank 1
Jesus asked on 28 Apr 2011, 04:14 PM
Hi,

I have RadComboBox which I want to have a value base on the time selected on RadTimePicker1 with interval of 15 mins. Let say I select 4:00 PM on RadTimePicker1 ,  RadComboBox value should be 3:45 PM, 3:30 PM, 3:15 PM and so on...

Pls. provide sample code on Code-behind C# or Javascript.

TIA

1 Answer, 1 is accepted

Sort by
0
Jesus
Top achievements
Rank 1
answered on 28 Apr 2011, 04:48 PM
Update: I was able to get through this code, just need to format the e.get_newTime() on its time:hour minute format only then the interval of 15 mins.

 var combo = $find('<%=RadTimePicker1.ClientID%>');
 var items = combo.get_items();
 combo.trackChanges();
 var comboItem = new Telerik.Web.UI.RadComboBoxItem();
 comboItem.set_text(e.get_newTime().toString());
  comboItem.set_value(e.get_newTime().toString());
 items.insert(0, comboItem);            
 combo.commitChanges();
Asked by
Jesus
Top achievements
Rank 1
Answers by
Jesus
Top achievements
Rank 1
Share this question
or