Can't set both DATE and TIME programmatically using RadDateTimePicker

2 posts, 0 answers
  1. Shane Clay
    Shane Clay avatar
    29 posts
    Member since:
    May 2010

    Posted 10 May 2012 Link to this post

    Hi All

    I'm having some trouble with the DateTimePicker;
    <telerik:RadDateTimePicker ID="dtpWhen" Width="200px" runat="server" AutoPostBackControl="Calendar">
        <TimeView ID="TimeView3" Interval="0:30" Columns="4" RenderDirection="Vertical" runat="server" />
        <Calendar>
            <SpecialDays>
                <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="Pink" />
            </SpecialDays>
        </Calendar>
    </telerik:RadDateTimePicker>

    When I call dtpWhen.DbSelectedDate = i("uatWhen"), the date is set correctly per the database, but the time is always set to 12:00.

    Debug.WriteLine(i("uatWhen")) gives 7/05/2012 10:48:59 AM as expected.

    I've also tried setting the value using just .SelectedDate with no luck.

    Does anyone see something I'm doing wrong?
  2. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 15 May 2012 Link to this post

    Hello Shane,

    Thank you for contacting us.

    Your declarative code seems to be fine. I have attached a sample page with RadDateTimePicker demonstrating how to access the selected date. Please give it a look and let me know if I am missing something out?

    Using the provided code you can get the selected time value and insert it to your sql datasource or wherever you intend to.

    Give it a try and let me know what the result is.

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top