Hi there,
i have a calendar for which i have added a number of repeatable special days (mon - fri), after adding these i add some other specific special dates.
However, the calendar is not rendered properly.
Firstly, the tooltips of the repeatable days are only shown in the current month view. If you change the month, all tooltips are lost for repeatable days. When returning to the current, only tooltips are shown for the first week, not the other weeks. I find this strange and unlogic behaviour.
Secondly, some days are shown differently in the initial month view after having navigated to another month. Also the days (weekends) that i have changed the background to red, are not shown in the initial month view, but they are shown red after i have changed months.
Thirdly, it seems that on initial month view on one day the standard repeatable day is shown over the specific exception day, and on another day in that month it is just the other way around, the specific exception day is shown over the standard repeatable day.
please see attached files, please advise on how to get my calendar showing proper exception days.
thanks in advance!
How do I make sure that the special days overrule the repeatable days? Or, what logic is used in rendering special days in the calendar?
Here's my code:
i have a calendar for which i have added a number of repeatable special days (mon - fri), after adding these i add some other specific special dates.
However, the calendar is not rendered properly.
Firstly, the tooltips of the repeatable days are only shown in the current month view. If you change the month, all tooltips are lost for repeatable days. When returning to the current, only tooltips are shown for the first week, not the other weeks. I find this strange and unlogic behaviour.
Secondly, some days are shown differently in the initial month view after having navigated to another month. Also the days (weekends) that i have changed the background to red, are not shown in the initial month view, but they are shown red after i have changed months.
Thirdly, it seems that on initial month view on one day the standard repeatable day is shown over the specific exception day, and on another day in that month it is just the other way around, the specific exception day is shown over the standard repeatable day.
please see attached files, please advise on how to get my calendar showing proper exception days.
thanks in advance!
How do I make sure that the special days overrule the repeatable days? Or, what logic is used in rendering special days in the calendar?
Here's my code:
protected void calAfleverDatum_PreRender(object sender, EventArgs e) |
{ |
DateTime myDate = DateTime.Today; |
string sToolTip; |
//-- Set Exception Days -- |
foreach (DeliveryCalendar_Exception myException in lCal_Exception) |
{ |
RadCalendarDay myDay = new RadCalendarDay(); |
myDay.Date = myException.ExceptionDate; |
myDay.IsSelectable = myException.IsDeliveryDay; |
myDay.IsDisabled = !myException.IsDeliveryDay; |
if (myException.IsDeliveryDay) |
myDay.ItemStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#a2d4a2"); |
else |
myDay.ItemStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#e4a2a4"); |
sToolTip = myDate.ToString("dddd, MMMM d, yyyy"); |
if (myException.Description.Length > 0) sToolTip += "\n\n" + myException.Description; |
if (myException.TimeFrom != null && myException.TimeTo != null) |
sToolTip += "\n\nVan: " + myException.TimeFrom.Value.ToShortTimeString() + " Tot: " + myException.TimeTo.Value.ToShortTimeString(); |
myDay.ToolTip = sToolTip; |
rdpAfleverDatum.Calendar.SpecialDays.Add(myDay); |
} |
//-- Set Standard Days -- |
while (myDate.DayOfWeek != DayOfWeek.Monday) myDate = myDate.AddDays(1); |
foreach (DeliveryCalendar_Standard myStandard in lCal_Standard) |
{ |
RadCalendarDay myDay = new RadCalendarDay(); |
myDay.Date = myDate; |
myDay.IsSelectable = myStandard.IsDeliveryDay; |
myDay.IsDisabled = !myStandard.IsDeliveryDay; |
myDay.Repeatable = Telerik.Web.UI.Calendar.RecurringEvents.Week; |
if (myStandard.IsDeliveryDay) |
myDay.ItemStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#a2d4a2"); |
else |
myDay.ItemStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#e4a2a4"); |
sToolTip = myDate.ToString("dddd, MMMM d, yyyy"); |
if (myStandard.TimeFrom != null && myStandard.TimeTo != null) |
sToolTip += "\n\nVan: " + myStandard.TimeFrom.Value.ToShortTimeString() + " Tot: " + myStandard.TimeTo.Value.ToShortTimeString(); |
myDay.ToolTip = sToolTip; |
rdpAfleverDatum.Calendar.SpecialDays.Add(myDay); |
myDate = myDate.AddDays(1); |
} |
} |