protected override void CreateChildControls() { //TODO: Add a way to set the rowspan attribute to be the number of divisions, Then not render the rest of the rows with that cell. if (this.ShowHeading) { DayCalendarDay HeadingDay = new DayCalendarDay(); HeadingDay.DayType = DayCalendarDayType.HeaderCell; HeadingDay.Text = this.HeadingText; HeadingDay.RowSpan = this.HeaderRowspan; this.Controls.Add(HeadingDay); } for (int i = 0; i < this.DayCalendar.NumberOfDays; i++) { DayCalendarDay Day = new DayCalendarDay(); Day.Day = this.DayCalendar.StartDate.AddDays(i); if (this.RowType == DayCalenderRowType.HeaderRow) { Day.DayType = DayCalendarDayType.HeaderCell; Day.Text = Day.Day.DayOfWeek.ToString(); } this.Controls.Add(Day); } }
public void Update() { this.Days.Clear(); DateTime date = this.DayCalendar.StartDate; do { DayCalendarDay Day = new DayCalendarDay(); if (this.RowType == DayCalenderRowType.HeaderRow) { Day.DayType = DayCalendarDayType.HeaderCell; //Day.Text = date.DayOfWeek.ToString(); Day.Text = date.Date.ToShortDateString(); } this.Days.Add(Day); //this.Controls.Add(Day); date = date.AddDays(1); } while (date.Date.CompareTo(this.DayCalendar.EndDate.Date) < 1); }