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

when does the TimeSlotCreated event get fired?

1 Answer 90 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Indranik
Top achievements
Rank 1
Indranik asked on 05 Jan 2009, 02:23 PM

Hi,
    I am trying to set backcolor of every timeslot according to working hours in a day. This means that if the slot comes between 0800 hrs and 1700hrs, the backcolor of the timeslot is white and if it falls beyond the given range i'm setting the backcolor to gray. This I am doing in the RadScheduler_TimeSlotCreated event. But it is not working.

 

protected

void RadScheduler_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)

 

{

 

    if (e.TimeSlot.Start.Hour < 8)

 

    {

        e.TimeSlot.CssClass =

"extended_business_hrs";

 

    }

}

 

I am not even sure if the event is getting fired or not

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 08 Jan 2009, 01:08 PM
Hello Indranik,

Please make sure that you have properly hooked on the OnTimeSlotCreated event.

For example, the following configuration works as expected:

[css]
.extended_business_hrs 
    background-colorblack

[aspx]
<telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="End" DataKeyField="ID" 
    DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" 
    DataSourceID="SqlDataSource1" DataStartField="Start" DataSubjectField="Subject" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated"
</telerik:RadScheduler> 

[c#]
protected void RadScheduler1_TimeSlotCreated(object sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e) 
    if (e.TimeSlot.Start.Hour < 16) 
    { 
        e.TimeSlot.CssClass = "extended_business_hrs"
    } 

Greetings,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Indranik
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or