Comments: ** Comment from web user: klange **
I am interested in this feature. My most common use case is that the user must enter a Date Of Birth for a record keeping system. I want to limit the data entry to a value that is possible for a living person. (Say 1/1/1850 - Now).
Also, I am usually storing the entered date in an SQL database where the datetime has a different range than the .Net DateTime. Currently, the date picker allows the user to enter a date such as 1/1/1111 that doesn't fit in SQL so I get an ugly exception down at the database layer.
So, currently, my solution is to use "Validation". But it would be cleaner to me if the user couldn't enter bad dates in the first place.
(For other people struggling with this issue, check out System.ComponentModel.DataAnnotations.RangeAttribute)
[Range(typeof(DateTime), "1/1/1900", "12/31/2099", ErrorMessage = "Value for {0} must be between {1} and {2}")]
Thanks.