Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I want to set display start and end date as 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.i want to set it globally to datepicker.
Disable past dates in datapicker if user entering date manually.after leaving cell focus i want to set it into my start date.otherwise it will throw error like " it will throw error like "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM" .please let me know if any custom validation to set min and max date for datepicker.

Thanks and Regards,
Josh
Posted
Updated 6-Dec-12 19:56pm
v6

1 solution

Have you tried this :
<DatePicker DisplayDateStart="1/1/1753" DisplayDateEnd="12/31/9999" Height="25" HorizontalAlignment="Left" Margin="239,74,0,0" Name="datePicker1" VerticalAlignment="Top" Width="205" />
 
Share this answer
 
Comments
josh-jw 7-Dec-12 1:05am    
thanks kunal for reply.but in my case if entered date manually like 12/7/0001.date picker accepting and it will throw error like "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.".please let me know if you have any idea
Rahul K Singh 7-Dec-12 1:09am    
Yes it is not working....It is showing the correct value but accepting the wrong values too.
josh-jw 7-Dec-12 1:12am    
yes.if u have any idea please suggest me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900