hello, this is kavita
we all use calender to select date . I m also using but the position of calender is static at runtime .how it can be moved at runtime ?
also a calender show few last day of previous month and few first day of next month to fill calender . how it can be removed?
Loading
Mohammed IsmailPosted Dec 27, 2006, 5:03 AM
For your second question removing of previous and next month days: you can not remove them but you can hide them by setting those days back and forecolors using OtherMonthDayStyle attribute of Calendar.
Eg:
But those cells are selectable in order to suppress this, add this in DayRender event of calendar:
if (e.Day.IsOtherMonth==true)
{
e.Cell.BackColor = System.Drawing.Color.Blue;
e.Cell.ForeColor = System.Drawing.Color.Blue;
e.Day.IsSelectable = false;
}
in Page_Load event add this:
Calendar1.Attributes["onMouseDown"] = "JavaScript:Void(0);";
try out this.