Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar Question: Disable Day Selection

Status
Not open for further replies.

suicidaltendencies

Programmer
Jan 28, 2004
58
US
How do you disable a day selection inside the day render event?

Thanks,
Harold
 
Code:
private void myCalendar_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
{
  // to disable all days selection
  e.Cell.Text = e.Day.DayNumberText;

  // to disable today's selection only
  if(e.Day.Date == DateTime.Today)
  {
    e.Cell.Text = e.Day.DayNumberText;
  }
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top