我使用Telerik RadCalendar ASP.NET控件。如何在代码中重置所选日期? (不设置选定日期)
答案 0 :(得分:1)
从他们的网站: 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.
首先,您可以使用get_selectedDates()查找选择的日期 然后将它们放入取消选择方法中。
var selectedDates = get_selectedDates();
unselectDates(selectedDates);
如果您不知道选择了哪些日期,也许您可以重新加载日历。
答案 1 :(得分:0)
如果要清除选择服务器端,那么这应该有效:
RadCalendarObject.SelectedDates.Clear();