Hi,
I have used calendar control in my application. The purpose of the calendar is to display the list of events which are occurring on the selected date. Its working fine when user selects any date. But if someone navigate to next month, the whole control is getting disabled. After navigating no one can selects the date nor navigate to previous month. I have used update panel for for calendar control.
Please have a look at the code and let me know the solution of this issue.
I have used calendar control in my application. The purpose of the calendar is to display the list of events which are occurring on the selected date. Its working fine when user selects any date. But if someone navigate to next month, the whole control is getting disabled. After navigating no one can selects the date nor navigate to previous month. I have used update panel for for calendar control.
Please have a look at the code and let me know the solution of this issue.
<
div
>
<
asp:UpdatePanel
ID
=
"upCalendar"
runat
=
"server"
UpdateMode
=
"Always"
>
<
ContentTemplate
>
<
telerik:RadCalendar
ID
=
"rCal"
runat
=
"server"
AutoPostBack
=
"true"
EnableMultiSelect
=
"false"
FastNavigationStep
=
"3"
EnableEmbeddedSkins
=
"true"
EnableEmbeddedBaseStylesheet
=
"true"
EnableMonthYearFastNavigation
=
"true"
DayNameFormat
=
"Short"
ShowRowHeaders
=
"true"
ShowOtherMonthsDays
=
"false"
Skin
=
"Default"
Width
=
"298px"
OnSelectionChanged
=
"rCal_SelectionChanged"
EnableViewState
=
"true"
>
<
TitleStyle
CssClass
=
"CalendarTitleStyle"
/><
SelectedDayStyle
CssClass
=
"CalendarDaySelectedClass"
/><
DayOverStyle
CssClass
=
"CalendarDayOverClass"
/>
</
telerik:RadCalendar
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
div
>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
rCal.RegisterWithScriptManager = false;
rCal.RangeMinDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
if (SelectedDateForSearch.HasValue)
{
rCal.SelectedDate = SelectedDateForSearch.Value;
rCal.FocusedDate = SelectedDateForSearch.Value;
}
}
}
protected void rCal_SelectionChanged(object sender, Telerik.Web.UI.Calendar.SelectedDatesEventArgs e)
{
if (e.SelectedDates.Count > 0)
{
DateTime selectedDate = rCal.SelectedDate.Date;
string url = "To any page"
Response.Redirect(url);
}
}