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

timeslotcreated

1 Answer 52 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
RAHUL
Top achievements
Rank 1
RAHUL asked on 11 Jun 2012, 10:59 AM
hi
i am completely stuck at a point while scheduling an appointment b/w doctor and a patient.
i want to know what does timeslotcreated eventArgs e mean in timeslot created event .
I have written my code as follows :

if (DateTime.Compare(e.TimeSlot.Start, Convert.ToDateTime("2012-06-06 08:30:00.000")) == 0 && DateTime.Compare(e.TimeSlot.End, Convert.ToDateTime("2012-06-06 08:45:00.000")) == 0)
{
e.TimeSlot.CssClass = "rsCategoryGreen";
}
if (DateTime.Compare(e.TimeSlot.Start, Convert.ToDateTime("2012-06-06 08:45:00.000")) == 0 && DateTime.Compare(e.TimeSlot.End, Convert.ToDateTime("2012-06-06 09:00:00.000")) == 0)
{
e.TimeSlot.CssClass = "rsCategoryGreen";
}

The whole slot of 08:30 - 09:00 is getting green. and when i remove upper IF then nothing happens in output.
please solve it or give an alternate solution to do this?





Still i am waiting for someone's reply. I want to clear my problem now..
I have an appointment of 2 hours and i want to customize it in different timespan like one of half an hour and second of one and half hour with different custom. So which event schould i use?
Reply soon

1 Answer, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 12 Jun 2012, 01:17 PM
Hi Rahul,

If you have set the property MinutesPerRow of RadScheduler to 15 minutes then the time slots in RadScheduler should represent a 15 minute-lasting row and you should not have problems styling a specific time slot.
The following works fine at my end -- the time slots from 8:30 to 8:45am and 9:45 to 10:00am are colored Green.
.rsCategoryGreen
{
    background-color: Green;
}
<telerik:RadScheduler runat="server" ID="RadScheduler1" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated"
    MinutesPerRow="15">
</telerik:RadScheduler>
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
{
    if (DateTime.Compare(e.TimeSlot.Start, Convert.ToDateTime("2012-06-12 08:30")) == 0
    && DateTime.Compare(e.TimeSlot.End, Convert.ToDateTime("2012-06-12 08:45")) == 0)
    {
        e.TimeSlot.CssClass = "rsCategoryGreen";
    }
    if (DateTime.Compare(e.TimeSlot.Start, Convert.ToDateTime("2012-06-12 09:45")) == 0
    && DateTime.Compare(e.TimeSlot.End, Convert.ToDateTime("2012-06-12 10:00")) == 0)
    {
        e.TimeSlot.CssClass = "rsCategoryGreen";
    }
}

All the best,
Ivana
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
Scheduler
Asked by
RAHUL
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Share this question
or