コード例 #1
0
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        RadCalendarDay radCalendarDay = new RadCalendarDay(RadCalendar1);

        radCalendarDay.Date = e.Appointment.Start;
        radCalendarDay.ItemStyle.CssClass = "DayWithAppointments";
        RadCalendar1.SpecialDays.Add(radCalendarDay);
        RadCalendar2.SpecialDays.Add(radCalendarDay);

        e.Appointment.Visible = false;
        keya();
        foreach (int key in checkBoxIDs.Keys)
        {
            CheckBox chkBox = PanelBar.Items[0].Items[0].FindControl(checkBoxIDs[key]) as CheckBox;


            if (chkBox.Checked)
            {
                Resource userRes = e.Appointment.Resources.GetResource("Calendar", key.ToString());
                if (userRes != null)
                {
                    e.Appointment.Visible = true;
                }
            }
        }
    }
コード例 #2
0
        protected void Calendar_OnDayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
        {
            try
            {
                // modify the cell rendered content for the days we want to be disabled (e.g. every Saturday and Sunday)
                if (e.Day.Date.DayOfWeek != DayOfWeek.Saturday) //|| e.Day.Date.DayOfWeek == DayOfWeek.Sunday)
                {
                    // if you are using the skin bundled as a webresource("Default"), the Skin property returns empty string
                    string calendarSkin       = dpWeekEnding.Calendar.Skin != "" ? dpWeekEnding.Calendar.Skin : "Default";
                    string otherMonthCssClass = "rcOutOfRange";

                    // clear the default cell content (anchor tag) as we need to disable the hover effect for this cell
                    e.Cell.Text     = "";
                    e.Cell.CssClass = otherMonthCssClass; //set new CssClass for the disabled calendar day cells (e.g. look like other month days here)

                    // render a span element with the processed calendar day number instead of the removed anchor -- necessary for the calendar skinning mechanism
                    Label label = new Label();
                    label.Text = e.Day.Date.Day.ToString();
                    e.Cell.Controls.Add(label);

                    // disable the selection for the specific day
                    RadCalendarDay calendarDay = new RadCalendarDay();
                    calendarDay.Date               = e.Day.Date;
                    calendarDay.IsSelectable       = false;
                    calendarDay.ItemStyle.CssClass = otherMonthCssClass;
                    dpWeekEnding.Calendar.SpecialDays.Add(calendarDay);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, typeof(string), "validation", "alert('" + ex.Message + "')", true);
            }
        }
コード例 #3
0
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        RadCalendarDay radCalendarDay = new RadCalendarDay(RadCalendar1);
        radCalendarDay.Date = e.Appointment.Start;
        radCalendarDay.ItemStyle.CssClass = "DayWithAppointments";
        RadCalendar1.SpecialDays.Add(radCalendarDay);
        RadCalendar2.SpecialDays.Add(radCalendarDay);

        e.Appointment.Visible = false;
        keya();
        foreach (int key in checkBoxIDs.Keys)
        {
            CheckBox chkBox = PanelBar.Items[0].Items[0].FindControl(checkBoxIDs[key]) as CheckBox;


            if (chkBox.Checked)
            {
                Resource userRes = e.Appointment.Resources.GetResource("Calendar", key.ToString());
                if (userRes != null)
                {
                    e.Appointment.Visible = true;
                }
            }
        }

    }
コード例 #4
0
ファイル: DnnDatePicker.cs プロジェクト: rrsc/Dnn.Platform
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     base.EnableEmbeddedBaseStylesheet = false;
     Utilities.ApplySkin(this);
     this.Calendar.ClientEvents.OnLoad = "$.dnnRadPickerHack";
     var specialDay = new RadCalendarDay();
     specialDay.Repeatable = Telerik.Web.UI.Calendar.RecurringEvents.Today;
     specialDay.ItemStyle.CssClass = "dnnCalendarToday";
     this.Calendar.SpecialDays.Add(specialDay);
 }
コード例 #5
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            base.EnableEmbeddedBaseStylesheet = true;
            Utilities.ApplySkin(this, string.Empty, "DatePicker");
            this.Calendar.ClientEvents.OnLoad = "$.dnnRadPickerHack";
            var specialDay = new RadCalendarDay();

            specialDay.Repeatable         = Telerik.Web.UI.Calendar.RecurringEvents.Today;
            specialDay.ItemStyle.CssClass = "dnnCalendarToday";
            this.Calendar.SpecialDays.Add(specialDay);
        }
コード例 #6
0
		protected override void OnInit(EventArgs e)
		{
			base.OnInit(e);
			base.EnableEmbeddedBaseStylesheet = true;
			Utilities.ApplySkin(this, string.Empty, "DatePicker");
			this.Calendar.ClientEvents.OnLoad = "$.dnnRadPickerHack";
			var specialDay = new RadCalendarDay();
			specialDay.Repeatable = Telerik.Web.UI.Calendar.RecurringEvents.Today;
			specialDay.ItemStyle.CssClass = "dnnCalendarToday";
			this.Calendar.SpecialDays.Add(specialDay);
            this.Calendar.RangeMinDate = (DateTime)SqlDateTime.MinValue;
            this.MinDate = (DateTime)SqlDateTime.MinValue;
        }
コード例 #7
0
ファイル: DatePicker.cs プロジェクト: dolani/CodeTorch
        public override void InitControl(object sender, EventArgs e)
        {
            base.InitControl(sender, e);

            try
            {
                ctrl.MinDate = Me.MinDate;
                ctrl.DateInput.DateFormat        = Me.DateFormat;
                ctrl.DateInput.DisplayDateFormat = Me.DisplayDateFormat;

                ctrl.Calendar.ShowRowHeaders = false;
                ctrl.Calendar.RangeMinDate   = Me.MinDate;
                ctrl.Calendar.RangeMaxDate   = Me.MaxDate;

                RadCalendarDay today = new RadCalendarDay();
                today.Repeatable         = Telerik.Web.UI.Calendar.RecurringEvents.Today;
                today.ItemStyle.CssClass = "rcToday";

                ctrl.Calendar.SpecialDays.Add(today);

                if (!String.IsNullOrEmpty(Me.Width))
                {
                    ctrl.Width = new Unit(Me.Width);
                }

                //ctrl.CssClass = "form-control";
                if (!String.IsNullOrEmpty(Me.CssClass))
                {
                    ctrl.CssClass += " " + Me.CssClass;
                }

                if (!String.IsNullOrEmpty(Me.SkinID))
                {
                    ctrl.SkinID = Me.SkinID;
                }

                if (!String.IsNullOrEmpty(Me.Skin))
                {
                    ctrl.Skin = Me.Skin;
                }
            }
            catch (Exception ex)
            {
                string ErrorMessageFormat = "ERROR - {0} - Control {1} ({2} - {3})";
                string ErrorMessages      = String.Format(ErrorMessageFormat, ex.Message, this.ControlID, Me.Type, this.ID);

                this.ctrl.ToolTip   = ErrorMessages;
                this.ctrl.BackColor = Color.Red;
            }
        }
コード例 #8
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            base.EnableEmbeddedBaseStylesheet = false;
            Utilities.ApplySkin(this);
            this.Calendar.ClientEvents.OnLoad = "$.dnnRadPickerHack";
            var specialDay = new RadCalendarDay();

            specialDay.Repeatable         = Telerik.Web.UI.Calendar.RecurringEvents.Today;
            specialDay.ItemStyle.CssClass = "dnnCalendarToday";
            this.Calendar.SpecialDays.Add(specialDay);
            this.Calendar.RangeMinDate = (DateTime)SqlDateTime.MinValue;
            this.MinDate = (DateTime)SqlDateTime.MinValue;
        }
コード例 #9
0
        /// <summary>
        /// Добавляет даты заездов в календарь. При этом происходит обновление доступного к выбору диапозона дат заездов.
        /// </summary>
        /// <param name="arrivalDates">добовляемые даты заездов</param>
        public void AddArrivalDates(IList <DateTime> arrivalDates)
        {
            if (arrivalDates == null)
            {
                throw new ArgumentNullException("arrivalDates");
            }

            // получаем сортированный массив дат заездов,
            // это нужно дальнешего заполнения отсутсвующих дней между датами заездов
            var arrivalsSorted = arrivalDates.Where(d => d.Date >= DateTime.Today).OrderBy(d => d).ToList();
            var arrivalsNmb    = arrivalsSorted.Count;

            for (var i = 0; i < arrivalsNmb; i++)
            {
                //if(arrivalsNmb == 0)
                //    break;

                // добовляем очердную дату заезда в календарь
                var clDay = new RadCalendarDay(clShared)
                {
                    Date = arrivalsSorted[i], IsSelectable = true
                };
                clShared.SpecialDays.Add(clDay);

                // проверяем есть ли следующая дата заезда
                if ((i + 1) >= arrivalsNmb)
                {
                    break;
                }

                // преверяем есть ли между текущей датой заезда и следующей разрыв в днях без вылета
                // если есть будем заполнять днями без перелетов между ними
                //if (clDay.Date.AddDays(1) == arrivalsSorted[i+1])
                //    break;

                for (var noArrivalDay = arrivalsSorted[i].AddDays(1); noArrivalDay < arrivalsSorted[i + 1]; noArrivalDay = noArrivalDay.AddDays(1))
                {
                    var clNoArrivDay = new RadCalendarDay(clShared)
                    {
                        Date         = noArrivalDay,
                        IsSelectable = false,
                        IsDisabled   = true
                    };
                    clShared.SpecialDays.Add(clNoArrivDay);
                }
            }
            UpdateSelectionMaxRange();
            UpdateAvailableRange();
        }
コード例 #10
0
        protected void RadCalendarAttendance_OnLoad(object sender, EventArgs e)
        {
            var siteLocation = (new CSiteLocation()).Get(CurrentSiteLocationId);
            var holiday      = (new CHoliday()).Get(siteLocation.Province);

            foreach (var h in holiday)
            {
                var cal = new RadCalendarDay();
                cal.Date         = h.HolidayDate;
                cal.IsSelectable = false;
                cal.ToolTip      = h.Name + (h.Abbreviation == string.Empty ? string.Empty : " (" + h.Abbreviation + ")") + " " + h.HolidayDate.Date.ToShortDateString();
                cal.IsDisabled   = true;
                RadCalendarAttendance.SpecialDays.Add(cal);
            }

            //RadCalendarAttendance.FocusedDate = DateTime.Today;
        }
コード例 #11
0
ファイル: DnnDatePicker.cs プロジェクト: rjallepalli/PIX_CMS
        protected override void OnInit(EventArgs e)
        {
			if (CultureInfo.CurrentCulture.Name == "ar-SA")
			{
				Culture.DateTimeFormat.Calendar = new GregorianCalendar();
			}

            base.OnInit(e);
            base.EnableEmbeddedBaseStylesheet = false;
            Utilities.ApplySkin(this);
            this.Calendar.ClientEvents.OnLoad = "$.dnnRadPickerHack";
            var specialDay = new RadCalendarDay();
            specialDay.Repeatable = Telerik.Web.UI.Calendar.RecurringEvents.Today;
            specialDay.ItemStyle.CssClass = "dnnCalendarToday";
            this.Calendar.SpecialDays.Add(specialDay);
            this.Calendar.RangeMinDate = (DateTime)SqlDateTime.MinValue;
            this.MinDate = (DateTime)SqlDateTime.MinValue;
        }
コード例 #12
0
        protected void RadCalendar1_OnLoad(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var cSiteLocation = (new CSiteLocation()).Get(CurrentSiteLocationId);
                var holiday       = (new CHoliday()).Get(cSiteLocation.Province);
                foreach (var h in holiday)
                {
                    var cal = new RadCalendarDay();
                    cal.Date         = h.HolidayDate;
                    cal.IsSelectable = false;
                    cal.ToolTip      = h.Name + (h.Abbreviation == string.Empty ? string.Empty : " (" + h.Abbreviation + ")") + " " + h.HolidayDate.Date.ToShortDateString();
                    cal.IsDisabled   = true;
                    RadCalendar1.SpecialDays.Add(cal);
                }

                var vacationList = (new CVacation()).GetDetail(Convert.ToInt32(ViewState["UserId"]));
                foreach (var v in vacationList)
                {
                    // without rejected, canceled
                    if (v.ApprovalStatus != (int)CConstValue.ApprovalStatus.Rejected && v.ApprovalStatus != (int)CConstValue.ApprovalStatus.Canceled)
                    {
                        CVacationDetail vacationDetail     = new CVacationDetail();
                        var             vacationDetailList = vacationDetail.Get(v.VacationId);
                        foreach (VacationDetail vd in vacationDetailList)
                        {
                            var cal = new RadCalendarDay();
                            cal.Date = vd.Date;

                            var cVacationDict = new CDict();
                            var vacationDict  = cVacationDict.GetDictByTypeAndValue(1376, v.VacationType);
                            var totalDays     = vacationDetailList.Count();

                            var cRequestDict = new CDict();
                            var requestDict  = cRequestDict.GetDictByTypeAndValue(217, (int)v.ApprovalStatus);

                            cal.ToolTip = vd.Date.ToShortDateString() + " " + vacationDict.Name + " (" + (vd.IsFullDay ? totalDays : totalDays - 0.5) + ") [" + requestDict.Name + "] No : " + v.VacationId;

                            switch (v.VacationType)
                            {
                            // Paid
                            case 0:
                                if (vd.IsFullDay)
                                {
                                    cal.TemplateID = "DayTemplatePaidFullDay";
                                }
                                else
                                {
                                    cal.TemplateID = "DayTemplatePaidHalfDay";
                                }
                                break;

                            // Unpaid
                            case 1:
                                if (vd.IsFullDay)
                                {
                                    cal.TemplateID = "DayTemplateUnPaidFullDay";
                                }
                                else
                                {
                                    cal.TemplateID = "DayTemplateUnPaidHalfDay";
                                }
                                break;

                            // SickDay
                            case 2:
                                if (vd.IsFullDay)
                                {
                                    cal.TemplateID = "DayTemplateSickFullDay";
                                }
                                else
                                {
                                    cal.TemplateID = "DayTemplateSickHalfDay";
                                }
                                break;

                            // Entitlement
                            case 3:
                                if (vd.IsFullDay)
                                {
                                    cal.TemplateID = "DayTemplateEntitlementFullDay";
                                }
                                else
                                {
                                    cal.TemplateID = "DayTemplateEntitlementHalfDay";
                                }
                                break;
                            }

                            RadCalendar1.SpecialDays.Add(cal);
                        }
                    }
                }

                // set this year jan 1
                RadCalendar1.FocusedDate = new DateTime(DateTime.Now.Year, 1, 1);
            }
        }
コード例 #13
0
        protected void RadCalendar1_OnLoad(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var cSiteLocation = (new CSiteLocation()).Get(CurrentSiteLocationId);
                var holiday       = (new CHoliday()).Get(cSiteLocation.Province);
                foreach (var h in holiday)
                {
                    var cal = new RadCalendarDay();
                    cal.Date         = h.HolidayDate;
                    cal.IsSelectable = false;
                    cal.ToolTip      = h.Name + (h.Abbreviation == string.Empty ? string.Empty : " (" + h.Abbreviation + ")") + " " + h.HolidayDate.Date.ToShortDateString();
                    cal.IsDisabled   = true;
                    RadCalendar1.SpecialDays.Add(cal);
                }

                var vacationList = (new CVacation()).GetDetail(Convert.ToInt32(ViewState["UserId"]));
                foreach (var v in vacationList)
                {
                    // without rejected, canceled
                    if (v.ApprovalStatus != (int)CConstValue.ApprovalStatus.Rejected && v.ApprovalStatus != (int)CConstValue.ApprovalStatus.Canceled)
                    {
                        CVacationDetail vacationDetail     = new CVacationDetail();
                        var             vacationDetailList = vacationDetail.Get(v.VacationId);
                        foreach (VacationDetail vd in vacationDetailList)
                        {
                            // except selectedDays to speaciaDays for selecting
                            if (RadCalendar1.SelectedDates.ToArray().Any(x => x.Date == vd.Date))
                            {
                                continue;
                            }

                            var cal = new RadCalendarDay();
                            cal.Date         = vd.Date;
                            cal.IsSelectable = false;

                            var vacationDict = (new CDict()).GetDictByTypeAndValue(1376, v.VacationType);
                            var totalDays    = vacationDetailList.Count();

                            var requestDict = (new CDict()).GetDictByTypeAndValue(217, (int)v.ApprovalStatus);

                            cal.ToolTip = vd.Date.ToShortDateString() + " " + vacationDict.Name + " (" + (vd.IsFullDay ? totalDays : totalDays - 0.5) + ") [" + requestDict.Name + "] No : " + v.VacationId;

                            switch (v.VacationType)
                            {
                            case (int)CConstValue.VacationType.PaidVacationDay:
                                if (vd.IsFullDay)
                                {
                                    cal.TemplateID = "DayTemplatePaidFullDay";
                                }
                                else
                                {
                                    cal.TemplateID = "DayTemplatePaidHalfDay";
                                }
                                break;

                            case (int)CConstValue.VacationType.UnPaidVacationDay:
                                if (vd.IsFullDay)
                                {
                                    cal.TemplateID = "DayTemplateUnPaidFullDay";
                                }
                                else
                                {
                                    cal.TemplateID = "DayTemplateUnPaidHalfDay";
                                }
                                break;

                            case (int)CConstValue.VacationType.SickDay:
                                if (vd.IsFullDay)
                                {
                                    cal.TemplateID = "DayTemplateSickFullDay";
                                }
                                else
                                {
                                    cal.TemplateID = "DayTemplateSickHalfDay";
                                }
                                break;

                            case (int)CConstValue.VacationType.EntitlementDay:
                                if (vd.IsFullDay)
                                {
                                    cal.TemplateID = "DayTemplateEntitlementFullDay";
                                }
                                else
                                {
                                    cal.TemplateID = "DayTemplateEntitlementHalfDay";
                                }
                                break;
                            }

                            RadCalendar1.SpecialDays.Add(cal);
                        }
                    }
                }

                // select current date
                if (RadCalendar1.SelectedDates.Count > 0)
                {
                    RadCalendar1.FocusedDate = RadCalendar1.SelectedDates[0].Date;
                }
            }
        }
コード例 #14
0
        private void GetCalendarAttendance()
        {
            ResetForm();
            if (RadGridClassStudent.SelectedValue != null)
            {
                RadCalendarAttendance.RangeMinDate = (DateTime)RadGridClassStudent.SelectedValues["StartDate"];
                RadCalendarAttendance.RangeMaxDate = (DateTime)RadGridClassStudent.SelectedValues["EndDate"];

                //// disable the selection for the specific day
                //var calendarDay = new RadCalendarDay();
                //calendarDay.Date = DateTime.Now;
                //calendarDay.IsToday = true;
                //calendarDay.ItemStyle.Font.Strikeout = true;
                //RadCalendarAttendance.SpecialDays.Add(calendarDay);

                var attendanceList = new CAttendance().Get(ProgramClassId, Convert.ToInt32(RadGridClassStudent.SelectedValues["StudentId"]));
                foreach (var a in attendanceList)
                {
                    var cal = new RadCalendarDay();
                    cal.Date = a.AttendanceDate;

                    var cAttendanceDict = new CDict();
                    var attendanceDict  = cAttendanceDict.GetDictByTypeAndValue(1515, a.AttendanceType);

                    cal.ToolTip = a.AttendanceDate.ToShortDateString() + " " + attendanceDict.Name + " [" + attendanceDict.Abbreviation + "]";

                    switch (a.AttendanceType)
                    {
                    //Absent
                    case 0:
                        cal.TemplateID = "DayTemplateAbsentAttendance";
                        break;

                    // Break(Vacation)
                    case 1:
                        cal.TemplateID = "DayTemplateBreakAttendance";
                        break;

                    // Dismissal
                    case 2:
                        cal.TemplateID = "DayTemplateDismissalAttendance";
                        break;

                    // Excuse
                    case 3:
                        cal.TemplateID = "DayTemplateExcuseAttendance";
                        break;

                    // Late
                    case 4:
                        cal.TemplateID = "DayTemplateLateAttendance";
                        break;

                    // Present
                    case 5:
                        cal.TemplateID = "DayTemplatePresentAttendance";
                        break;

                    // Probation
                    case 6:
                        cal.TemplateID = "DayTemplateProbationAttendance";
                        break;

                    // Co - op / JSHINE Practicum / Practicum
                    case 7:
                        cal.TemplateID = "DayTemplateCoopAttendance";
                        break;

                    // Withdrawal
                    case 8:
                        cal.TemplateID = "DayTemplateWithdrawalAttendance";
                        break;
                    }

                    RadCalendarAttendance.SpecialDays.Add(cal);
                }

                var startDate      = (DateTime)RadGridClassStudent.SelectedValues["StartDate"];
                var endDate        = (DateTime)RadGridClassStudent.SelectedValues["EndDate"];
                var totalDay       = GetWorkingDays(startDate, endDate);
                var attendanceDays = RadCalendarAttendance.SpecialDays.Cast <RadCalendarDay>().Count(s => s.IsSelectable);

                RadTextBoxAttendanceCount.Text = attendanceDays + " / " + totalDay;
                // percent of total rate
                RadTextBoxAttendanceRate.Text = Math.Round(((attendanceDays / (double)totalDay) * 100), 2) + " %";
            }
        }
コード例 #15
0
		/// <summary>
		/// The Schedules_Edit control is made up of a set of date windows, each with a begin date, end date, and lock toggle. The set of date 
		/// windows is passed/assigned to this control by the page or control hosting us. To keep this control generic, we don't know how many 
		/// date windows we'll get to display, so we'll assume the set is handed to us and we can iterate through them one by one. Given that, 
		/// the configuration of each date window is the same - consisting of a radDatePicker control for the begin date, a radDatePicker 
		/// control for the end date, and a radButton made to look like a check box for the lock/unlock toggle. Iterating through the set of 
		/// date windows, we will build and configure the controls for each window here in the code-behind.  
		/// </summary>
		public void RenderEditControl()
		{
			if (ScheduleTypes != null)
			{
				int i = 1; //intentionally set to 1 so as to create row and insert after the header row.
				foreach (Scheduling.ScheduleType schedType in ScheduleTypes)
				{
					HtmlTableRow row = new HtmlTableRow();

					HtmlTableCell cell;
					//
					// Create the label - this label describes this date window is for.
					//
					Label lbl = new Label();
					lbl.Text = schedType.TypeName;
					lbl.CssClass += " Schedules_Edit_Control label " + schedType.TypeName;
					lbl.Attributes.Add("ScheduleTypeID", schedType.TypeID.ToString());
					lbl.Attributes.Add("DocTypeID", schedType.DocTypeID.ToString());
					lbl.Attributes.Add("DefaultValues", "");
					cell = new HtmlTableCell();
					cell.Controls.Add(lbl);
					row.Controls.Add(cell);

					//
					// Create the Begin Date Control
					//
					RadDatePicker ctrlBegDate = new RadDatePicker();
					ctrlBegDate.ID = schedType.TypeName + "_ctrlBeginDate";
					ctrlBegDate.CssClass += " Schedules_Edit_Control BeginDate " + schedType.TypeName;

					//Styling for our calendar control
					ctrlBegDate.Skin = "Vista";		//just one of Telerik's styles - If we don't specify, then what you get is a ghost-like transparency.

					//Styling - Make current date stand out (but not selected).
					RadCalendarDay rcd = new RadCalendarDay();
					rcd.Repeatable = RecurringEvents.Today;
					rcd.ItemStyle.BackColor = System.Drawing.Color.Bisque;
					ctrlBegDate.Calendar.SpecialDays.Add(rcd);

					ctrlBegDate.MinDate = new DateTime(1980, 1, 1);
					ctrlBegDate.MaxDate = new DateTime(3000, 12, 31);

					// If a default date is provided, then a) set our control to that date, and b) store off date as an attribute
					if (!string.IsNullOrEmpty(schedType.DefaultStart))
					{
						ctrlBegDate.SelectedDate = DataIntegrity.ConvertToDate(schedType.DefaultStart);
						lbl.Attributes["DefaultValues"] = schedType.DefaultStart;
					}
					else
						lbl.Attributes["DefaultValues"] = DateTime.Now.ToString();
					// Add control to the row.
					cell = new HtmlTableCell();
					cell.Controls.Add(ctrlBegDate);
					row.Controls.Add(cell);

					//
					// Create the End Date Control
					//
					RadDatePicker ctrlEndDate = new Telerik.Web.UI.RadDatePicker();
					ctrlEndDate.ID = schedType.TypeName + "_ctrlEndDate";
					ctrlEndDate.CssClass += " Schedules_Edit_Control EndDate " + schedType.TypeName;

					//Styling for our calendar control
					ctrlEndDate.Skin = "Vista";		//just one of Telerik's styles - If we don't specify, then what you get is a ghost-like transparency.

					//Styling - Make current date stand out (but not selected).  rcd was created up above for use in ctrlBegDate.
					ctrlEndDate.Calendar.SpecialDays.Add(rcd);
					ctrlEndDate.MinDate = new DateTime(1980, 1, 1);
					ctrlEndDate.MaxDate = new DateTime(3000, 12, 31);

					// If a default date is provided, then a) set our control to that date, and b) store off date as an attribute
					if (!string.IsNullOrEmpty(schedType.DefaultEnd))
					{
						ctrlEndDate.SelectedDate = DataIntegrity.ConvertToDate(schedType.DefaultEnd);
						lbl.Attributes["DefaultValues"] += "|" + schedType.DefaultEnd;
					}
					else
						lbl.Attributes["DefaultValues"] = "|" + DateTime.Now.ToString();
					// Add control to the row.
					cell = new HtmlTableCell();
					cell.Controls.Add(ctrlEndDate);
					row.Controls.Add(cell);

					//
					// Create the Clear Dates image
					//
					HtmlImage img = new HtmlImage();
					img.ID = schedType.TypeName + "_ctrlClearDates";
					img.Attributes.Add("class", " Schedules_Edit_Control ClearDates " + schedType.TypeName);
					img.Src = "~/Images/Eraser_Small.png";
					img.Attributes.Add("OnClick", "Schedules_Edit_Control.ClearDatesByType(\"" + schedType.TypeName + "\")");
					// Add control to the row.
					cell = new HtmlTableCell();
					cell.Controls.Add(img);
					row.Controls.Add(cell);

					//
					// Create Lock/Unlock check box.
					//
					RadButton ctrlRadButton = new Telerik.Web.UI.RadButton();
					ctrlRadButton.ButtonType = RadButtonType.ToggleButton;
					ctrlRadButton.ToggleType = ButtonToggleType.CustomToggle;
					ctrlRadButton.ID = schedType.TypeName + "_btnToggle";
					ctrlRadButton.CssClass += " Schedules_Edit_Control Toggle " + schedType.TypeName;
					ctrlRadButton.AutoPostBack = false;
					// Add to our button the toggle states
					RadButtonToggleState tglState = new RadButtonToggleState();
					tglState.PrimaryIconCssClass = "rbToggleCheckbox";
					ctrlRadButton.ToggleStates.Add(tglState);
					
					tglState = new RadButtonToggleState();
					tglState.PrimaryIconCssClass = "rbToggleCheckboxChecked";
					ctrlRadButton.ToggleStates.Add(tglState);

					tglState = new RadButtonToggleState();
					tglState.PrimaryIconCssClass = "rbToggleCheckboxFilled";
					ctrlRadButton.ToggleStates.Add(tglState);

					// Set default value for our check box
					// The check boxes in this control are a three-state checkbox - 
					//	 - not checked,
					//	 - checked,
					//	 - heterogeneous (a state representing multiple schedules some of which are checked and others of which are not.
					//
					// The initial state of the checkboxes should be set to "Heterogeneous" (numeric value of 2) because the schedule 
					// control is not even displayed until user clicks on a schedule in the grid.  At that point, there is javascript 
					// logic in AssessmentScheduling.ascx that will populate the checkboxes and dates within this control according to 
					// business logic there.  By setting the checkbox to 2, the logic in AssessmentScheduling.ascx will interpret this 
					// to mean that the checkbox has not been set to any value yet.
					//
					
					if (schedType.DefaultLock.HasValue)
					{
						ctrlRadButton.SelectedToggleStateIndex = (schedType.DefaultLock.Value ? cbxChecked : cbxUnchecked);
						lbl.Attributes["DefaultValues"] += "|" + (schedType.DefaultLock.Value ? cbxChecked.ToString() : cbxUnchecked.ToString());
					}
					else
					{
						ctrlRadButton.SelectedToggleStateIndex = cbxFilled;
						lbl.Attributes["DefaultValues"] += "|" + cbxFilled.ToString();
					}
					// Add our button to the row
					cell = new HtmlTableCell();
					cell.Controls.Add(ctrlRadButton);
					row.Controls.Add(cell);

					// Add our row to the table.
					SchedControlsTable.Rows.Insert(i, row);
					i++;
				}
				Schedules_Edit_EditPanel.Visible = true;
				Schedules_Edit_ResultPanel.Visible = false;
			}
			else
			{
				lblResultMessage.Text = "No scheduling purposes found.";
				Schedules_Edit_EditPanel.Visible = false;
				Schedules_Edit_ResultPanel.Visible = true;
			}
		}