[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 806
  • Last Modified:

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
0
jackrock79
Asked:
jackrock79
  • 2
1 Solution
 
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now