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

SelectedDate property

3 Answers 87 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Srinivas
Top achievements
Rank 1
Srinivas asked on 28 Sep 2010, 01:08 PM


Hello telerik,
the selecteddate property is returnnig a selected a date with a time stamp '12:00' ..which is not the time i select from the datetimepicker control. how to get rid of this?

i tried , 'selecteddate.value.date ' ...its of no use. still its giving me with  12:00

Thanks,
Srinivas

3 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 28 Sep 2010, 03:53 PM
Hello Srinivas,

I would suggest you to use SelectedValue instead of SelectedDate property. SelectedDate returns only the selected value from the date part of the RadDateTimePicker control. SelectedValue returns the selected date and time value.

I hope this helps! 

Sincerely yours,
George
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
0
Srinivas
Top achievements
Rank 1
answered on 28 Sep 2010, 04:01 PM
Hello george,
Thanks for the reply.  please find the more details of my requirement.

I am writing a custom control for datetimepicker . In that i need a property by name 'selected date' which only gives me the date part only. i have written the dependency proprty of type  Datetime? . which is resulting me a seleted date with 12:00 included to the selecteddate. i dont wont that 12:00 with the resulted value. I dont want to use selectedvalue because it includes both date and time.
i need only date part.


Regards,
Srinivas

0
George
Telerik team
answered on 01 Oct 2010, 01:33 PM
Hi Srinivas,

Unfortunately, there is no date type in .Net framework. If you want to extract only the date, you could use SelectedValue.Value.ToShortDateString() method. This returns the selected date in a string format.

I hope this helps.
 

Sincerely yours,
George
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
DateTimePicker
Asked by
Srinivas
Top achievements
Rank 1
Answers by
George
Telerik team
Srinivas
Top achievements
Rank 1
Share this question
or