This is a migrated thread and some comments may be shown as answers.

RadCalendar SpecialDays - overlap?

1 Answer 80 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
SlimSjakie
Top achievements
Rank 2
SlimSjakie asked on 11 Jun 2010, 01:52 PM
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:

 

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);  
            }  
        } 

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 17 Jun 2010, 07:00 AM
Hi Chris,

Please find our answer in the other thread you have posted on the same subject and to avoid duplicate posts I suggest that we continue your case discussion there as well.

All the best,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Calendar
Asked by
SlimSjakie
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
Share this question
or