Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
using month calendar control how to disable the sunday using csharp

Note It is windows application.

I have month calendar, in that i want to disable sunday using csharp.

for that how can i do .

Please help me.

Regards & Thanks,
Narasiman P.
Posted

1 solution

C#
void DayRender(Object source, DayRenderEventArgs e)
{
  // disable the cell for all sunday in the month.
  if (e.Day.Date.DayOfWeek == DayOfWeek.Sunday)
     e.Cell.Enables = false;
}
 
Share this answer
 
Comments
[no name] 20-Feb-13 5:53am    
how to add DayRender using month calendar in csharp

it is windows application

help me.
Azziet 20-Feb-13 5:58am    
it is an event ..just write above code in your code block

you can also check e.Day.Date.DayOfWeek.Enables or Disables property
Carsten Giesen 15-May-13 5:38am    
Sorry, he ask for WINDOWS APPLICATION not for web!
There is no dayrender event!
Not in C# and not in VB.NET :(

I'm searching for the same for days now....
Azziet 20-Feb-13 6:06am    
you can check this link,,,,....

http://joshrharrison.com/archive/2008/04/12/disable-days-on-asp.net-calendar-control.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900