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

Can't set both DATE and TIME programmatically using RadDateTimePicker

1 Answer 109 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Shane Clay
Top achievements
Rank 1
Shane Clay asked on 10 May 2012, 02:32 PM
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?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 15 May 2012, 10:57 AM
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.
Tags
Calendar
Asked by
Shane Clay
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or