Calendar Control - Make certain week days inactive. Is this possible?

0 views
Skip to first unread message

sso

unread,
Nov 10, 2009, 10:49:01 PM11/10/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi,

I need to make certain week days on the calendar inactive. Is there
any means of doing this server-side?

Thanks!

Raghupathi Kamuni

unread,
Nov 11, 2009, 4:08:49 AM11/11/09
to dotnetde...@googlegroups.com

<asp:Calendar ID="Calendar1" runat="server"  OnDayRender="Calendar1_OnDayRender"></asp:Calendar>

protected void Calendar1_OnDayRender(object sender, DayRenderEventArgs e)
 {
      //if ( something == somecondition )
       //{
               //To Inactivate the day
               e.Day.IsSelectable = false;
                //To strike out the day
                e.Cell.Font.Strikeout = true; 
        //}
 }
Reply all
Reply to author
Forward
0 new messages