Improved appointment rendering in RadScheduler for ASP.NET AJAX, Q1 2010

Friday, March 12, 2010 by ASP.NET AJAX Team | Comments 13

Now that Q1 2010 release is out in the wild, we can sit down and discuss some of the changes we decided to make in the new release. One of them is the new appointment rendering of RadScheduler - a potentially breaking change, but a much needed one.

While trying to improve the performance of RadScheduler, I noticed that the number of resources slows down the rendering and overall performance considerably. This had to be expected - the images to support the appointment rounded corners (and the predefined resources) were quite large. However, I didn’t take into account that all browsers keep for performance reasons their images uncompressed in memory and with the color depth of the current desktop. A simple calculation later I discovered that the appointment sprite itself is taking 25MB memory when loaded. Add 5 resources to the fray and you have 150MB memory down with a single blow. As it turns out - a sprite image is not a panacea, if it gets too big - don’t be afraid to break it in two. The loading time may suffer, but your browser suffers more while rendering a 25MB monster.

First I thought of undertaking the aforementioned solution - breaking the appointment sprite in two and thus reducing the two appointment sprites to mere 2MB uncompressed. Then I thought - the rounded corners are small - I can use borders and backgrounds to simulate rounded appointment borders while still keeping the same HTML structure. The gradients can be done with a single 10x50px image plus we have a gain - border colors and backgrounds can be changed on the fly.

 I started with five rendering elements at first, then tried with four and finally I settled on only three elements.  Behold the new appointment rendering (quite simple really):

AppRenderingSliced      AppRenderingWhole

On the left you can see that the first container has only top and bottom borders and a background. In fact, the background isn’t even needed since it will be obscured by the elements on top of it. The whole first container is only needed for the four dots that reside in the four corners of the appointment. On top of this container is another one that holds the left and right borders and slightly lighter background to create the illusion of a second lighter border beside the other two. At last on top of all others is placed the text container that also holds the top and bottom borders and the gradient background. On the right you can see the final result - I’m quite happy with it and I hope you will be too. Overall this is what happens:

RoundedCornersExplained

After creating the new rendering we took another step further - we decided to use alpha gradients for the resource rendering, thus supporting any color appointments with rounded corners and gradients. You can see some examples below:AppRenderingResourcesWe plan on adding BorderColor and BackColor properties  to the ResourceStyles definitions for Q1 SP1.

However with the new rendering in Q1 2010 we do support BackColor and BorderColor appointment properties - you only need to set AppointmentStyleMode=”Default” to keep RadScheduler from switching to Simple appointment rendering. Here is one screenshot of RadScheduler with appointments set to different colors:

AppRenderingColors

I hope that you will enjoy working with the new appointments in RadScheduler.

If you have problems with your old custom skins, include the old base stylesheet along with your RadScheduler and set EnableEmbeddedBaseStylesheet=”false” in your RadScheduler. You can find the said base stylesheet attached to this post.

 

RadScheduler base stylesheet

13 Comments

  • Mark 12 Mar 2010
    What do you suggest for a RadScheduler that manages 55 resources in TimeLineView. I am now using resource paging with 9 resources per page but it is still painfully slow?
    Does the appointment sprite cost 25 MB for each appointment or is it only a one time overhead? What happens if I have 20 appointments on the screen at once?
    I also color my appointments in the code-behind as per the documentation. Is that still the correct way?
    Thanks for your feedback

  • Kamen 12 Mar 2010
    The 25 MB are one time overhead per resource, though if you set BackColor and BorderColor from code-behind RadScheduler Q3 2009 is automatically switching to Simple appointment rendering (non-rounded one). If you set ResourceStyle from code-behind, then you are using the memory-hungry sprites. If you do the latter, then I suggest upgrading to the new release. If not - the Simple appointment rendering is the same as before, but the new rendering is almost as light so you can still benefit from upgrading.
  • Mark 12 Mar 2010
    Thanks Kamen. I have already upgraded to Q1 2010 and see no noticable speed improvement for my situation. That is why I was wondering if I had to flip a switch somewhere or avoid using some technique I used in Q3 2009. I do set BackColor, Forecolor and BorderColor from within the AppointmentDataBound event. This allows me to have the ten (10) different colored appointments I need.
    I guess my question is why do I not see a difference in speed and what can I do to achieve it (in my application) within the RadScheduler?
    Thanks for your help
  • Kamen 12 Mar 2010
    So you are using the Simple appointment rendering. If you want to switch to the new one, you can set AppointmentStyleMode=”Default” in your RadScheduler. However if even with Simple or the new rendering you still experience slowdowns, then your case needs a more thorough examination and you better file a support ticket with more detailed information. We will try our best to help you fix this issue.
  • Matthew 18 May 2010
    Hi Kamen, thanks for the handy blog post. I just wanted to know if there is a way to have AppointmentStyleMode=”Default” but not use Gradient background. With the colours I am using for my background it looks a bit naff with a gradient, can I force it to be a solid colour without losing the rounded corners? Cheers.
  • Kamen Bundev 18 May 2010
    Adding this CSS rule to your stylesheet should do it:

    div.RadScheduler .rsApt .rsAptContent 
        background-imagenone
  • Matthew 18 May 2010
    Thanks Kamen, that worked perfectly.
  • Nguyen Binh An 12 Jul 2010
    I used RadScheduler Q3 2009. Now I upgrade to Q1 2010, however I can not use Mac skin?

    thanks,
    An


  • Nguyen Binh An 12 Jul 2010
    I used RadScheduler Q3 2009. Now I upgrade to Q1 2010, however I can not use Mac skin?

    thanks,
    An


  • Kamen Bundev 13 Jul 2010
    The Mac skin for RadScheduler was discontinued in Q2 2008. If you are using an external Mac skin, can you file a support ticket to send the skin over along with any images and we will take a look.
  • jose 19 Oct 2010
    Hi,

    I put 

    div.RadScheduler .rsApt .rsAptContent 
        background-imagenone


    But I can't see any improvement! How can I improve the speed of the Scheduler using Ajax and Post ?? I already put AppointmentStyleMode="Default" but it didn't seem to improve a lot my speed.

    Could you give me anymore tips?? It's taking 500-800 seconds from request to request in my local machine! I'm using Q1 2010, would the Q2 would be any faster? 

    regards,

    jose
  • Kamen Bundev 20 Oct 2010
    Can you open a support ticket and describe the issue more thoroughly and we will try to help you fix it? A live URL or a sample project with the issue isolated will further help us reproduce the issue and pinpoint what is causing it.
  • Rodrigo 15 Mar 2011
    Good morning,

    I downloaded the trial version, and I wonder if it is possible to adapt the CSS for my needs? If yes, where I set the system to read the CSS file?

    Sincerely,
    Rodrigo Peixoto

Add comment

  1. Formatting options
       
     
     
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)