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

styling 15 mintues slots

5 Answers 45 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Malik
Top achievements
Rank 1
Malik asked on 18 Mar 2010, 10:30 AM

Is there any way to change the colour of 15 mintues slot's . I found the article in which it's showed how the change the colour for an hour slot. below is my code. please can help me how to change the colour of 15 minutes slots.
thanks



 

protected void RadScheduler1_TimeSlotCreated(object sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e)

 

{

 

if (dsAppointments == null)

 

 

{

 

 

 dsAppointments = GetAppointments(this.RadScheduler1.SelectedDate);

 

 

}

 

 

 foreach (DataRow row in dsAppointments.Tables[0].Rows)

 

 

 {

 

 

 DateTime start = Convert.ToDateTime(row["start"]);

 

 

 DateTime end = Convert.ToDateTime(row["end"]);

 

 

 // if ((e.TimeSlot.Start.Date.ToShortDateString() == start.ToShortDateString()) && ((e.TimeSlot.Start.Hour >= start.Hour && e.TimeSlot.End.Hour <= end.Hour) && (e.TimeSlot.Start.Minute >= start.Minute && e.TimeSlot.End.Minute <= start.Minute)) && (e.TimeSlot.Resource.Text == Convert.ToString(row["StaffName"])))

 

 

 if (e.TimeSlot.Resource.Text == Convert.ToString(row["StaffName"]))

 

 

 {

 

 

 if ((e.TimeSlot.Start.Date.ToShortDateString() == start.ToShortDateString()) && ((e.TimeSlot.Start.Hour >= start.Hour && e.TimeSlot.End.Hour <= end.Hour )))

 

 

 {

 

 

 e.TimeSlot.CssClass = "Disabled";

 

 

 }

 

 

 }

 

 

 }

 

5 Answers, 1 is accepted

Sort by
0
Malik
Top achievements
Rank 1
answered on 19 Mar 2010, 10:31 AM
Is there anyone can answer please. I posted this  yesterday morning. thanks
0
Peter
Telerik team
answered on 19 Mar 2010, 02:21 PM
Hi Mike,

Please, try setting MinutesPerRow="15" for RadScheduler. Does this help you achieve your goal?

All the best,
Peter
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.
0
Malik
Top achievements
Rank 1
answered on 19 Mar 2010, 03:18 PM
thanks for your reply.

It's already setup MinutesPerRow="15". I have timeslots for example 8.30 to 12.45. I  want to change the colour of these slots from 8.30 to 12.45.
I can only change the colour from 8.00 to 1:00 not for 15" mintues slots.
Is there anyway i can achive this? thanks in advance.
0
Malik
Top achievements
Rank 1
answered on 22 Mar 2010, 11:38 AM
Guys, since four days i haven't got the solution. Please can someone tell me is it possible or not ?
0
Peter
Telerik team
answered on 25 Mar 2010, 10:18 AM
Hello Malik,

Forums do not guarantee that you will receive a reply to your questions. If you need to have an issue resolved urgently and reliably, we recommend you send a support ticket.

Now, to your problem - here is a code sample a tried and it yielded the desired result:
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
   {
       if (e.TimeSlot.Start >= new DateTime(2010, 3, 25, 8, 30, 0) & e.TimeSlot.End <= new DateTime(2010, 3, 25, 12, 45, 0))
       {
           e.TimeSlot.CssClass = "CustomCss";
       }
   }

Attached is a simple demo for reference.

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