Limit date range in a DatePicker

£可爱£侵袭症+ 提交于 2019-11-27 08:26:13

问题


First of, is there any real documentation of the toolkit ? What I would like is to specify a range of selectable dates. For example I don't want to display dates before today. If the user select a start date of Jan. 27th 2012, I want to allow only dates after these for the return date


回答1:


Documentation is a little bit sparse for the toolkit - your best bet is to look in the source of the sample app but they don't cover all the scenarios.

The default control doesn't seem to support a minimum or maximum value for the selected date, but if you download the source you should be able to modify it according to your needs. The layout of the source is pretty straightforward and you should be able to find an acceptable place to add the code, the only thing you need to decide is how you handle it from a UI perspective. In my opinion, you are better off handling the range check once the control returns - if it is an invalid date, pop up a message and re-show the control.




回答2:


I've found that in the absence of documentation, the WindowsPhoneGeek blog (in this specific case see link here) usually does a good job of explaining the Silverlight Toolkit components in their various articles.

These articles can be a great help when following ZombieSheep's advice of taking a look at the toolkit sample code.



来源:https://stackoverflow.com/questions/9031509/limit-date-range-in-a-datepicker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!