Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > Calendar > Disabling calendar days

Disabling calendar days

Feed from this thread
  • Posted on Feb 6, 2007 (permalink)

    Requirements

    RadCalendar for ASP .NET version

    RadControls for ASP .NET AJAX version

    2.0.x and later



    2008.3.1105 and later


    .NET version

    2.0 (RadCalendar for ASP .NET)


    2.0 and later (RadControls for ASP .NET AJAX)

    Visual Studio version

    2005/2008 (RadCalendar for ASP .NET)


    2005 and later(RadControls for ASP .NET AJAX)

    Programming language

    C#, VB, Javascript
    Browser support

    all supported by RadCalendar for ASP .NET

    all browsers supported by RadControls for ASP .NET AJAX


     
    PROJECT DESCRIPTION
    This project demonstrates how you can disable calendar days (e.g. weekend days) in the calendar component of RadDatePicker. In order to achieve the desired functionality you need to handle both the server-side DayRender and client-side OnDayRender events of the calendar control - the former is necessary for disabling the days on initial page load or postback (the client-side event is not executed on page load) and the latter - for disabling the days on client-side navigation to a different month view. Basically the idea is to replace the default cell content (anchor tag) with a span element and modify the appearance of the disabled days - the specific implementation of the server-side and the client-side event handlers varies and can be found in the attached project with inline comments.

    The same technique works for stand-alone calendar as well.

Back to Top

Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > Calendar > Disabling calendar days