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

How to custimize the calendar form view on RadScheduler's navigation panel?

10 Answers 120 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 29 Mar 2013, 04:09 AM
Hi,

I have one requirement. I want to highlight the days which has schedule events on RadScheduler's navigation panel. Could you give me some comments? Is there any event which I could use on navigation panel drop icon click?

Alex

10 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 02 Apr 2013, 10:36 AM
Hello Alex,

I would suggest reviewing the following help article that demonstrates how you can highlight days which has schedule events in popup calendar. If this is not the functionality you are trying to achieve, please elaborate a bit more on your scenario.


Regards,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Alex
Top achievements
Rank 1
answered on 03 Apr 2013, 02:53 AM
Hi Boyan,

Yes, that's what I am expected. But I want to set the special days to be bold not the background color. Now I could get it worked with setting background color but setting the font to be bold cannot work. Even add "font-weight:bold !important" cannot make it work. Do you know why?

RadCalendar popupCalendar = _view.ResourceScheduler.FindControl("SelectedDateCalendar") as RadCalendar;
            if (popupCalendar != null)
            {
                foreach (Appointment a in _view.ResourceScheduler.Appointments)
                {
                    RadCalendarDay dayWithAppointment = new RadCalendarDay();
                    dayWithAppointment.ToolTip = a.Subject;
                    dayWithAppointment.Date = a.Start;
                    dayWithAppointment.ItemStyle.Font.Bold = true;
                    popupCalendar.SpecialDays.Add(dayWithAppointment);
                }
            }


Alex
0
Alex
Top achievements
Rank 1
answered on 03 Apr 2013, 06:13 AM
Hi Boyan,

I have made it worked by adding class name ".DayWithAppointments a". But as you know, our appointments will be different every month, I cannot get all the appointments one time. So could you tell me what events should be used by clicking "<" and">"?

Alex
0
Boyan Dimitrov
Telerik team
answered on 03 Apr 2013, 01:02 PM
Hello,

I would suggest adding a different class to your dayWithAppointment object based on some condition - in your case that might be the current appointment month. In the code snippet below, a css class "April" is added if the current appointment' month is April. The rest of the appointments will have "otherMonth" class. Following that pattern you can differentiate your appointments and apply different styles based on some conditions. 
//markup code
<telerik:RadScheduler runat="server" ID="RadScheduler1" OnPreRender="RadScheduler1_PreRender">        
</
telerik:RadScheduler>
//code behind
protected void RadScheduler1_PreRender(object sender, EventArgs e)
    {
        RadCalendar popupCalendar = RadScheduler1.FindControl("SelectedDateCalendar") as RadCalendar;
        if (popupCalendar != null)
        {
            popupCalendar.Skin = "Sunset";
 
            foreach (Appointment a in RadScheduler1.Appointments)
            {
                RadCalendarDay dayWithAppointment = new RadCalendarDay();
                dayWithAppointment.ToolTip = a.Subject;
                dayWithAppointment.Date = a.Start;
                 
                if (a.Start.Month == 4)
                {
                    dayWithAppointment.ItemStyle.CssClass = "April";
                }
                else
                {
                    dayWithAppointment.ItemStyle.CssClass = "otherMonth";
                }          
                popupCalendar.SpecialDays.Add(dayWithAppointment);
            }
        }
    }
//css
<style type="text/css">
       .RadCalendar .rcRow td.April a {
           color:red;
       }
       .RadCalendar .rcRow td.otherMonth a {
           color:blue;
       }
   </style>

Kind regards,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Alex
Top achievements
Rank 1
answered on 07 Apr 2013, 03:31 AM
Hi Boyan,

Thanks for your comments. Maybe I am not clear. What I want is to highlight days which have appointments in RadCalendar form view on radScheduler.

Now I could highlight days in mehtod "preRender". But if the month is changed by clicking navigation "<", the calender view will be changed and I should highlight days again. How could I do that? What events should I use when clicking "<" or ">" in server codes?

Alex
0
Boyan Dimitrov
Telerik team
answered on 08 Apr 2013, 04:06 PM
Hello,

I would like to clarify that the event associated with clicking on next/previous month on the RadScheduler navigation panel is OnNavigationCommand. Here you may find more information about that specific event and its arguments.


Kind regards,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Alex
Top achievements
Rank 1
answered on 09 Apr 2013, 01:01 AM
Hi Boyan,

I have noticed that. But when I adding NavigationCommand event, it always be called after selecting one date. It cannot be called when I click ">" or "<" on the navigation view. Do you know why?

resourceScheduler.NavigationCommand += ResourceSchedulerNavigationCommand;


Alex
0
Boyan Dimitrov
Telerik team
answered on 11 Apr 2013, 03:17 PM
Hello,

I would like to apologize for the misunderstanding in our communication.

Your observations are absolutely correct, when user clicks on the RadScheduler embedded calendar previous/next month is not firing any event out of the box.
Therefore I have prepared a sample project that implements the following scenario - in the server-side event Page_Load the RadScheduler embedded calendar is subscribed for the OnCalendarViewChanged client-side event. From that event handler using RadAjaxManager you can do a Ajax request in order to perform some modifications to the RadScheduler each time when user clicks  on previous/next month arrows on the embedded calendar.
Please review the following links related to the RadCalendar client-side events and the RadAjaxManager AjaxRequest event

Hope that this will be helpful.

Kind regards,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Alex
Top achievements
Rank 1
answered on 12 Apr 2013, 08:16 AM
Hi Boyan,

Really thanks for your example. I have tried it could work. But in my codes, as it has many user controls in my codes and they are calling each other, they cannot work. All the server codes can be debuged with no error. Is this because our RadScriptManager is in Site.Master.cs file?

Alex
0
Boyan Dimitrov
Telerik team
answered on 16 Apr 2013, 03:17 PM
Hello Alex,

Could you please explain what exactly is not working in your project? Please clarify is there any JavaScript errors that might cause the described unusual behavior?
Our recommended approach is adding your RadScriptManager to the master page of your project, because only one instance of the RadScriptManager is allowed on a page.

Please find here some detailed information about our RadScriptManager.

Regards,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Calendar
Asked by
Alex
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Alex
Top achievements
Rank 1
Share this question
or