protected void OnHtmlTimeCellPrepared(object sender, ASPxSchedulerTimeCellPreparedEventArgs e) { TimeInterval cellInterval = e.Interval; if (e.View.Type == DevExpress.XtraScheduler.SchedulerViewType.Day) { TimeSpan dinnerStart = new TimeSpan(15, 0, 0); TimeSpan dinnerEnd = new TimeSpan(17, 0, 0); TimeSpan cellStart = cellInterval.Start.TimeOfDay; TimeSpan cellEnd = cellInterval.End.TimeOfDay; if (cellStart >= dinnerStart && cellStart <= dinnerEnd && cellEnd <= dinnerEnd) { e.Cell.BackColor = Color.Red; string valueString = HtmlConvertor.ToHtml(Color.Yellow); e.Cell.Style.Add("border-bottom-color", valueString); e.Cell.Style.Add("text-align", "center"); e.Cell.Controls.Add(new LiteralControl("dinner")); } } if (e.View.Type == SchedulerViewType.Week) { DateTime specialDate = new DateTime(2008, 7, 24); if (cellInterval.Start == specialDate) { e.Cell.BackColor = Color.Green; } } }
static void Scheduler_HtmlTimeCellPrepared(object handler, ASPxSchedulerTimeCellPreparedEventArgs e) { //var rid = e.Resource.Id.ToString(); //var Interval = e.Interval; //e.Cell.BackColor = e.Cell.BackColor; ////e.Cell.Style.Add("color", System.Drawing.ColorTranslator.ToHtml(ColorHelper.InvertColor(e.Cell.BackColor))); //e.Cell.Style.Add("text-align", "center"); //e.Cell.Controls.Add(new LiteralControl("N/A")); }
protected void ASPxScheduler1_HtmlTimeCellPrepared(object handler, ASPxSchedulerTimeCellPreparedEventArgs e) { if (!ResourcesAvailabilities.IsIntervalAvailableForResource(e.Resource.Id.ToString(), e.Interval)) { e.Cell.BackColor = ControlPaint.Dark(e.Cell.BackColor); //e.Cell.Style.Add("color", System.Drawing.ColorTranslator.ToHtml(ColorHelper.InvertColor(e.Cell.BackColor))); e.Cell.Style.Add("text-align", "center"); e.Cell.Controls.Add(new LiteralControl("N/A")); } }
protected void Scheduler_HtmlTimeCellPrepared(object handler, ASPxSchedulerTimeCellPreparedEventArgs e) { e.Cell.CssClass += " droppable"; }
static void Scheduler_HtmlTimeCellPrepared(object handler, ASPxSchedulerTimeCellPreparedEventArgs e) { }