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

Time Picker midnight

1 Answer 62 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
SOR DevTeam
Top achievements
Rank 1
SOR DevTeam asked on 13 Jul 2009, 03:53 PM
How can I get 12:00AM or later to display at the end of the time picker's list?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Jul 2009, 06:40 AM
Hi Mark,

I tried following approach to customize the time view in RadTimePicker which will show 12:00AM at the end of the TimeView. Give a try with this.

ASPX:
 
<telerik:RadTimePicker ID="RadTimePicker1" runat="server">  
</telerik:RadTimePicker> 

C#:
 
protected void Page_Load(object sender, EventArgs e)  
{  
    DateTime dt = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 1, 0, 0); // Set the Start Time  
    List<DateTime> dateList = new List<DateTime>();  
    for (int hour = 0; hour < 24; hour++)  
        dateList.Add(dt.AddHours(hour)); // Adding interval  
    RadTimePicker1.TimeView.DataList.DataSource = dateList;  

Thanks,
Princy.
Tags
Calendar
Asked by
SOR DevTeam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or