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

Set RadTimePicker time interval from C#

1 Answer 218 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Shahi
Top achievements
Rank 1
Shahi asked on 04 Apr 2013, 03:05 AM
Hi,

I have a RadTimePicker in which I want to set its interval property from the code behind. I had tried setting but everytime
it is displaying a type conversion error. So can anyone help me how to set the same from code behind?

Thanks,
Shahi

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 04 Apr 2013, 04:25 AM
Hi Shahi,

The Interval property of RadTimePicker is of type System.TimeSpan. If you try to set it simply using quotes or using another type such as System.DateTime, you will get a type conversion error. Please check the following sample C# code.

C#:
//setting time interval as 20 minutes. The format is new TimeSpan(hour, minutes, seconds)
timePicker.TimeView.Interval = new TimeSpan(0, 20, 0);

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