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

DateTimePicker time popup empty

3 Answers 145 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Ryan Lege
Top achievements
Rank 1
Ryan Lege asked on 14 Jul 2009, 07:04 AM
When I set up the following, it works once and then all subsequent runs result in the TimePicker popup being devoid of times.  If I do not set the SelectedDate, the error never occurs, but once it does the error persists even after I remove the SelectedDate setting.  I am using military time.  I have reverted to non-military time and everything works now, but my customer wants military time.  Please fix this bug!

                            RadDateTimePicker1.SelectedDate =

DateTime.Now;

 



                            <telerik:RadDateTimePicker ID="RadDateTimePicker1" Runat="server"
                                    Calendar-Orientation="RenderInColumns" Culture="English (United States)"
                                        DateInput-DateFormat="M/d/yyyy HH:mm:ss" DateInput-MaxLength="0"
                                        DateInput-SelectionOnFocus="None" Skin="Forest" TimeView-Columns="5"
                                        TimeView-Interval="00:10:00" TimeView-TimeFormat="HH:mm"
                                        onselecteddatechanged="RadDateTimePicker2_SelectedDateChanged">
                                        <TimePopupButton HoverImageUrl="" ImageUrl="" />
                                        <TimeView runat="server" CellSpacing="-1">
                                            <HeaderTemplate>
                                                Time Picker
                                            </HeaderTemplate>
                                            <TimeTemplate>
                                                <a id="A1" runat="server" href="#"></a>
                                            </TimeTemplate>
                                        </TimeView>
                                        <DateInput runat="server">
                                        </DateInput>
                                        <Calendar runat="server" Orientation="RenderInRows" Skin="Forest"
                                            UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                            ViewSelectorText="x">
                                        </Calendar>
                                        <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                    </telerik:RadDateTimePicker>

Thanks,

Nate

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 16 Jul 2009, 02:51 PM
Hello Benjamin,

Could you please let us know what is the format of the military time? Is it something like ddMMMyy?
For example: 12Nov09

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ryan Lege
Top achievements
Rank 1
answered on 20 Jul 2009, 07:15 AM

Thanks for your reply.  As seen in my code below, I am using:  M/d/yyyy HH:mm:ss  which yields 7/20/2009 13:23:10.

Thanks,

Nate
0
Daniel
Telerik team
answered on 20 Jul 2009, 01:37 PM
Hello Nate,

In my opinion the reason that causes an empty TimeView in this case is that you haven't set a text in the TimeTemplate. Therefore I recommend you try the following modification:
<telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server" Calendar-Orientation="RenderInColumns" 
    Culture="English (United States)" DateInput-DateFormat="M/d/yyyy HH:mm:ss" DateInput-MaxLength="0" 
    DateInput-SelectionOnFocus="None" Skin="Forest" TimeView-Columns="5" TimeView-Interval="00:10:00" 
    TimeView-TimeFormat="HH:mm"
    <TimePopupButton HoverImageUrl="" ImageUrl="" /> 
    <TimeView ID="TimeView1" runat="server" CellSpacing="-1"
        <HeaderTemplate> 
            Time Picker 
        </HeaderTemplate> 
        <TimeTemplate> 
            <id="A1" text runat="server" href="#"
                <%# DataBinder.Eval(Container, "DataItem.Time", "{0:hh:mm tt}") %></a
        </TimeTemplate> 
    </TimeView> 
    <DateInput ID="DateInput1" runat="server"
    </DateInput> 
    <Calendar ID="Calendar1" runat="server" Orientation="RenderInRows" Skin="Forest" 
        UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"
    </Calendar> 
    <DatePopupButton HoverImageUrl="" ImageUrl="" /> 
</telerik:RadDateTimePicker> 

RadTimeView Templates

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Ryan Lege
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Ryan Lege
Top achievements
Rank 1
Share this question
or