问题
I use Telerik RadCalendar ASP.NET control. How I can in code reset selected date? (Set no selected Date)
回答1:
From their site: 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.
var selectedDates = get_selectedDates();
unselectDates(selectedDates);
If you dont know what dates are selected maybe you can reload the calendar.
回答2:
If you want to clear the selection server-side then this should work:
RadCalendarObject.SelectedDates.Clear();
来源:https://stackoverflow.com/questions/2509537/telerik-radcalendar-asp-net-control-reset-date