using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using DayRenderEventArgs = Telerik.Web.UI.Calendar.DayRenderEventArgs;

public partial class Default4 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //RadCalendar.DayRender += DayRender_OnlyMondays;
        RadCalendar.DayRender += DayRender_AllDays;
    }

    protected void ajxmgr_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (string.Compare(e.Argument, "AllDays") == 0)
            RadCalendar.DayRender += DayRender_AllDays;
        else if (string.Compare(e.Argument, "Mondays") == 0)
            RadCalendar.DayRender += DayRender_OnlyMondays;

    }

    protected void DayRender_OnlyMondays(object sender, DayRenderEventArgs e)
    {
        RadCalendarDay calendarDay = new RadCalendarDay();
        if (e.Day.Date.DayOfWeek == DayOfWeek.Monday) return;
        //e.Cell.CssClass = "disabledCalDay";
        e.Cell.CssClass = "disabledCalDay";
        e.Cell.ToolTip = "Only Mondays are enabled for selection.";

        Label label = new Label { Text = e.Day.Date.Day.ToString() };
        e.Cell.Controls.Add(label);

        calendarDay.Date = e.Day.Date;
        calendarDay.IsSelectable = false;
        calendarDay.IsDisabled = true;
        RadCalendar.SpecialDays.Add(calendarDay);
    }
    protected void DayRender_AllDays(object sender, DayRenderEventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        RadCalendar.DayRender += DayRender_OnlyMondays;
    }
}
