I've got a RadTimePicker in Grid EditForm, and I need to set the Min/Max and Interval/StartTime/EndTime
I've tried setting them in the ItemDatabound of the grid when in edit mode, and on PreRender of the control itself, if I step through debugger, I can see the value get's changed. But when the editform is rendered, I get the default 1 hour interval.
I'm at a loss as what else to try.
Thanks in advance.
Roger
I've tried setting them in the ItemDatabound of the grid when in edit mode, and on PreRender of the control itself, if I step through debugger, I can see the value get's changed. But when the editform is rendered, I get the default 1 hour interval.
I'm at a loss as what else to try.
Thanks in advance.
Roger
<
telerik:RadTimePicker
ID
=
"txtcmps_StartTime"
runat
=
"server"
Width
=
"175px"
TimeView-Columns
=
"4"
OnPreRender
=
"txtcmps_StartTime_PreRender"
TimeView-Height
=
"300"
TimeView-Width
=
"325"
DbSelectedDate='<%# Bind("cmps_StartTime") %>' TimeView-CssClass="TimePicker" FocusedDate="1/1/1900 12:00:00 AM" MinDate="1/1/1900 12:00:00 AM" DateInput-MinDate="1/1/1900 12:00:00 AM" > </
telerik:RadTimePicker
>
Code
Public Sub txtcmps_StartTime_PreRender(sender As Object, e As System.EventArgs)
'We'll set our start and end times and interval for txtcmps_StartTime
If Not IsNothing(ViewState("cmp_StartTime")) Then
Dim txtcmps_StartTime As Telerik.Web.UI.RadTimePicker = CType(sender, Telerik.Web.UI.RadTimePicker)
txtcmps_StartTime.MinDate = CType(ViewState("cmp_StartTime"), DateTime)
txtcmps_StartTime.MaxDate = CType(ViewState("cmp_EndTime"), DateTime)
txtcmps_StartTime.TimeView.Interval = New TimeSpan(0, CType(ViewState("cmp_EnrollmentInterval"), Integer), 0)
txtcmps_StartTime.TimeView.StartTime = New TimeSpan(CType(ViewState("cmp_StartTime"), DateTime).Hour, CType(ViewState("cmp_StartTime"), DateTime).Minute, CType(ViewState("cmp_StartTime"), DateTime).Second)
txtcmps_StartTime.TimeView.EndTime = New TimeSpan(CType(ViewState("cmp_EndTime"), DateTime).Hour, CType(ViewState("cmp_EndTime"), DateTime).Minute, CType(ViewState("cmp_EndTime"), DateTime).Second)
End If
End Sub