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

Appointment styles

4 Answers 70 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
chinnu
Top achievements
Rank 1
chinnu asked on 04 Feb 2012, 12:26 PM
Hi

I need a requirement like ,I need to show a particular duration having appointment in a particular color.I mean I dont want to show the appointment name or I dont want to see it like a projected section.I just want to show a light green color to indicate that an appointment has beed scheduled in the particular duration.

For eg : If an appointment is given for 9 to 9.20 I dont want to show it as a projection.I just need the section as such empty ,but with a different colour.Just to indicate that the particular timing has an appointment scheduled.

I searched a lot .But all search ends with giving cssclass/colour to the appointment given.I dont want that type.I just want to show the given appointment duration with different colour.I dont want to show a projected appointment block.Just need a colour change in the whole duration or time slot.This must be shown whether the user selects day,week or month type view.

Any help is appreciated..
Regards
Chinnu :)

4 Answers, 1 is accepted

Sort by
0
chinnu
Top achievements
Rank 1
answered on 08 Feb 2012, 07:47 AM
Helloooo

No one knows the answer????.............

Chinnu
0
Ivana
Telerik team
answered on 08 Feb 2012, 05:09 PM
Hi,

You could subscribe to the TimeSlotCreated server-side event and set CSS classes to the TimeSlots for  which appointments are arranged.

Example:
protected void RadScheduler1_TimeSlotCreated(object sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e)
{
    if (e.TimeSlot.Appointments.Count > 0)
    {
        foreach (Appointment item in e.TimeSlot.Appointments)
        {
            item.CssClass = "Hidden";
        }
        e.TimeSlot.CssClass = "Disabled";
    }
}
<style type="text/css">
    .Disabled
    {
        background-color: Olive;
    }
     
    .Hidden
    {
        visibility: hidden;
    }
</style>
<telerik:RadScheduler runat="server" ID="RadScheduler1" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated">
</telerik:RadScheduler>

I hope this helps.

Greetings,
Ivana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
chinnu
Top achievements
Rank 1
answered on 09 Feb 2012, 07:38 AM
Hi

Thank you for the reply.

This is ok.
But a problem is there.
My scheduler minutesperrow is 5
It is if an appointment is from 8.00 to 8.10 , the colour extends only from 8.00 to 8.05 means that time slot only.
How can I solve this.Please help.

Regards
Chinu
0
Ivana
Telerik team
answered on 14 Feb 2012, 10:01 AM
Hi,

You could try the following:

protected void RadScheduler1_TimeSlotCreated(object sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e)
{
    IList<Appointment> appt = RadScheduler1.Appointments.GetAppointmentsInRange(e.TimeSlot.Start, e.TimeSlot.End);
         
    if (appt.Count > 0)
    {
        e.TimeSlot.CssClass = "Disabled";
    }
}
This approach, however, has its limitation when an all-day appointment is created. You could refer to the following KB article for more information how to set special TimeSlots in RadScheduler:

Setting special days or time slots in RadScheduler.


I hope this helps.

Greetings,
Ivana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Scheduler
Asked by
chinnu
Top achievements
Rank 1
Answers by
chinnu
Top achievements
Rank 1
Ivana
Telerik team
Share this question
or