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

Set default time on DateTimePicker

9 Answers 230 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jeff Tang
Top achievements
Rank 1
Jeff Tang asked on 18 Jun 2009, 03:55 AM
My situation is that I want the time of the DateTimePicker can be filled with 23:59 when the user only use the popup calendar to select a date but haven't selected the time in the TimeView. And the user can also type in the datetime in the textbox to change the value, but in this case won't fill in 23:59. Can anyone have any solution? Thanks.

9 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Jun 2009, 07:17 AM
Hi Jeff Tang,

You can review the following code library submission which will help you set a default time to the RadDateTimePicker.
Set default time in RadDateTimePicker

Thanks,
Princy.
0
Pavlina
Telerik team
answered on 18 Jun 2009, 07:48 AM
Hello Jeff,

Please find attached a simple runnable application that demonstrates the desired functionality. Give it a try and see if it works for you or if I am leaving something out.

I hope this helps.

Sincerely yours,
Pavlina
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.
0
Jeff Tang
Top achievements
Rank 1
answered on 19 Jun 2009, 01:32 AM
Thank you for your reply. In fact I also use the same method to set the default time, but the main problem is that when the user want to change the time by typing, the event also triggered to set the time to 23:59, thus the user can't change the time by keyborad.
0
Jeff Tang
Top achievements
Rank 1
answered on 19 Jun 2009, 01:33 AM
Thank you for your reply. In fact I also use the same method to set the default time, but the main problem is that when the user want to change the time by typing, the event also triggered to set the time to 23:59, thus the user can't change the time by keyborad.
0
Pavlina
Telerik team
answered on 19 Jun 2009, 08:11 AM
Hi Jeff,

I am sending you a modified project.
Please give it a try and let me know if this is the expected behavior.

Kind regards,
Pavlina
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.
0
Jeff Tang
Top achievements
Rank 1
answered on 19 Jun 2009, 09:43 AM
Thank you for your reply. However, it's not a completed solution for me. Let me further explain my target behavior.

- At anytime when the textbox is blank, and the user click on the calendlar, the time will be set to 23:59.
- At anytime when the textbox is blank, and the user type in only the date part,  the time will also be set to 23:59.
0
Accepted
Pavlina
Telerik team
answered on 24 Jun 2009, 11:50 AM
Hi Jeff,

I am afraid that the desired functionality could be hardly achieved with RadDateTimePicker control. It is a limitation of the client events of the control and we could not differentiate when user want to change the time/date by keyboard, or click on the calendar.

I will gladly assist you if other questions arise.

Sincerely yours,
Pavlina
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.
0
Randy
Top achievements
Rank 1
answered on 08 Mar 2010, 06:38 PM
Wow, I really see this limitation as a really short sidedness ont he datetimepicker control.  I don't understand why the control doesn't have a default time property that we can set in design time?  For example:  DefaultSelectedTime="23:59:59" or something like that.  Telerik should be able to put logic in there control that when the user selects the date or types in the date that it automatically sets the date/time value with the DefaultSelectedTime attribute.  What are your thoughts Telerik?  I think this is a common need.  I create parameter pages for people to execute reports and I could see where this is needed.  Yes, I know we can write logic when the date is passed to the data layer params to add the 23:59:59 to the date, but seriously, should the UI controls tell the data what the correct parameters are?  If this was a web service, I should have to tell my web service consumers that I will automatically append the 23:59:59, I want them to specify the exact time they want the data.

Anyways...
0
Pavlina
Telerik team
answered on 09 Mar 2010, 04:18 PM
Hello Randy,

I am sending you a simple working application which handles the required functionality. Please give it a try and let me know if it works as expected or if I am leaving something important out.

I hope this helps.

Regards,
Pavlina
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
Input
Asked by
Jeff Tang
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Pavlina
Telerik team
Jeff Tang
Top achievements
Rank 1
Randy
Top achievements
Rank 1
Share this question
or