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

Datepicker & TimePicker

1 Answer 67 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Robin Verhulst
Top achievements
Rank 1
Robin Verhulst asked on 03 May 2010, 11:00 AM
I want to pass a DateTime object  to a method of mine .
now i have a datepicker and a timepicker

How do i make the time of the returned value of datepicker into the time from timepicker.

Currently i have this , but it doesn't work.

 DateTime? date = new DateTime(); 
                date = rdpDate.SelectedDate; 
                //date.Value.AddSeconds(rtpTime.SelectedTime.Value.Seconds); 
                //date.Value.AddMinutes(rtpTime.SelectedTime.Value.Minutes); 
                //date.Value.AddHours(rtpTime.SelectedTime.Value.Hours); 
                //date.Value.t 
 
                //date.Value.AddHours(Double.Parse(rtpTime.SelectedTime.Value.Hours.ToString())); 
                //date.Value.ToShortDateString(); 
                 date.Value.Date.AddHours(rtpTime.SelectedTime.Value.Hours); 

1 Answer, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 05 May 2010, 04:32 PM
Hello Robin Verhulst,

I can't understand exactly what are you trying to do. But as far as I understand you are trying to take the date part of your DateTime object from the DatePicker and the time part from the TimePicker. If I have understood right you need to use ViewModel. I have attached a sample application which shows how this can be done.

If you have further questions please let me know.

Regards,
Boyan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
DatePicker
Asked by
Robin Verhulst
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or