Calendar Control: How to disable hyperlink for a date and how to remove dates from other months

I have a calendar control in which I want to disable hyperlink on few dates based on some values and also I dont want the dates from other months to be displayed.

Can someone help me with this??

Thanks
Jack
LVL 2
jackrock79Asked:
Who is Participating?
 
mmarinovCommented:
you can use this
private void Calendar1_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
{
      if ( e.Day.Date.Month != DateTime.Now.Month )
      {
          e.Cell.Text = ""; //clears the cell's
      }
      if ( e.Day.Date.Day == 5 )
          e.Day.IsSelectable = false;
}

B..M
0
 
jackrock79Author Commented:
Thanks for the code
0
 
mmarinovCommented:
Hi jackrock79, why Grade B - isn't this code what you are looking for ?

B..M
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.