DateTimePicker time popup empty

4 posts, 0 answers
  1. Ryan Lege
    Ryan Lege avatar
    42 posts
    Member since:
    Sep 2008

    Posted 14 Jul 2009 Link to this post

    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
  2. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 16 Jul 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ryan Lege
    Ryan Lege avatar
    42 posts
    Member since:
    Sep 2008

    Posted 20 Jul 2009 Link to this post


    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
  5. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 20 Jul 2009 Link to this post

    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.
Back to Top