简体   繁体   English

Telerik RadCalendar ASP.NET控件重置日期

[英]Telerik RadCalendar ASP.NET control reset date

I use Telerik RadCalendar ASP.NET control. 我使用Telerik RadCalendar ASP.NET控件。 How I can in code reset selected date? 如何在代码中重置所选日期? (Set no selected Date) (设置未选择日期)

From their site: http://demos.telerik.com/aspnet-ajax/calendar/examples/programming/clientsideapi/defaultcs.aspx 从他们的网站: http : //demos.telerik.com/aspnet-ajax/calendar/examples/programming/clientsideapi/defaultcs.aspx

unselectDate(date); //Takes a triplet representation of a date and if valid deselects it in the calendar.
unselectDates(dates);  //Takes an array of triplets representing dates and if valid deselects them in the calendar. 

First you can find what dates are selected with get_selectedDates() Then put them in the unselect method. 首先,您可以使用get_selectedDates()查找选择的日期,然后将其放入unselect方法中。

var selectedDates = get_selectedDates();
unselectDates(selectedDates);

If you dont know what dates are selected maybe you can reload the calendar. 如果您不知道选择了什么日期,则可以重新加载日历。

如果您想清除选择服务器端,那么这应该起作用:

RadCalendarObject.SelectedDates.Clear();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM