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

TimePicker handle only minutes

1 Answer 35 Views
Input
This is a migrated thread and some comments may be shown as answers.
Random
Top achievements
Rank 1
Random asked on 17 Aug 2012, 08:43 AM
Hi.

I would like to know if its possible to set the TimePicker to handle only minutes?
So instead of having an input of "01:30" (HH:mm) it should be 90 only.

Also that the PopUp to pick values, displays as follows

instead of --> it should be
00:55 --> 55
01:00 --> 60
01:05 --> 65
and so on...

Hope you can help me.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 21 Aug 2012, 01:46 PM
Hello,

You could modify the RadDateTimePicker's TimeView items using the following approach:
protected void RadDateTimePicker1_ItemDataBound(object sender, Telerik.Web.UI.Calendar.TimePickerEventArgs e)
{
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    {
        DateTime cellTime = DateTime.Parse(((e.Item as DataListItem).Controls[0] as HtmlGenericControl).InnerText);
        ((e.Item as DataListItem).Controls[0] as HtmlGenericControl).InnerText = (cellTime.Hour * 60 + cellTime.Minute).ToString();
    }
}

For implementing additional custom functionality, you could use the DateInput-ClientEvents-OnValueChanging and DateInput-ClientEvents-OnError events.

I hope this will prove helpful.

Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
Random
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or