How to disable the past dates in calendar control.
For this you need to write following simple code on DayRender event of calendar.
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date<System.DateTime.Today)
{
e.Cell.BackColor = System.Drawing.Color.LightGray;
e.Day.IsSelectable = false;
}
}
---------------------------------------------------------------------
For this you need to write following simple code on DayRender event of calendar.
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date<System.DateTime.Today)
{
e.Cell.BackColor = System.Drawing.Color.LightGray;
e.Day.IsSelectable = false;
}
}
---------------------------------------------------------------------
No comments:
Post a Comment