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

CSS not rendering on initial page load

4 Answers 74 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 08 Oct 2008, 02:33 PM
I have a feeling this has something to do with my implementation, but I cannot figure out how to fix this.  I have a RadScheduler control set up with a custom provider that only provides the method stubs (does not return any data).  For simplicity,  I am not returning any appointments with the provider.  The RadScheduler is set up with the Outlook skin, but I get this issue with all skins.

I am starting in the day view.  My issue is that when the page initially loads, my CSS does not seem to get applied  Ultimately what I am going for is to have the non-work hours grayed out.   Once the page loads, if I click the link to show all hours, then the page refreshes and my CSS is applied.  Likewise, if I start in week view the CSS does not initially show; but if I then switch to Day view, the CSS is applied.  Can someone point me to what I may be doing wrong?

On the page that contains the RadScheduler, I have the following CSS Snippet:
<style type="text/css">
        .RadScheduler_Outlook .rsCell
        {
            background-color: #BAACA8;
        }
</style>

In my Page Load event, all I have is the following:
       RadScheduler1.Provider = New MyProvider()
       SetDayTimes()

The Navigate event for the Scheduler contains only this line:
         SetDayTimes()

This is the tag for my RadScheduler control:
<telerik:RadScheduler ID="RadScheduler1" runat="server" OverflowBehavior="Expand" Skin="Outlook"></telerik:RadScheduler>

The SetDayTimes method simply sets the DayStartTime, DayEndTime, WorkDayStartTime, and WorkDayEndTime values to preset TimeSpans.

Thanks,
Andrew

4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 08 Oct 2008, 03:44 PM
Hello Andrew,

I recommend you use the TimeSlotCreated event as shown in this kb article.


Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andrew
Top achievements
Rank 1
answered on 08 Oct 2008, 07:04 PM
Thanks!  That is what I was looking for.  

I'd also like to extend this further - is it possible to do the same thing on the day view with grouping?  I am grouping my day view by employees, and each employee will have a different start/end time for the day.  Any suggestions on that?  I'd need to figure out not only the time slot but also the resource, in order to conditionally shade my cells.

- Andrew
0
Peter
Telerik team
answered on 09 Oct 2008, 12:43 PM
Hi Andrew,

You can get the resource for each time slot (if any resource is associated) with the following code:
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)  
    {  
        string[] indexParts = e.TimeSlot.Index.Split(':');  
        int resourceIndex = int.Parse(indexParts[0]);  
        List<Resource> resources = new List<Resource>(RadScheduler1.Resources.GetResourcesByType("Room"));  
        Resource res = resources[resourceIndex];  
        if (res != null)  
        {   
            //custom code here  
        }  
    } 

For Q3 2008 we will expose a property of the TimeSlot object to easily access the resource. In the meanwhile, the above workaround should suffice. Let us know if you have further questions.


All the best,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andrew
Top achievements
Rank 1
answered on 09 Oct 2008, 02:10 PM
Thank you.  This method of getting the resource work's well.  It will be a great addition to the Q3 release.
Tags
Scheduler
Asked by
Andrew
Top achievements
Rank 1
Answers by
Peter
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or