Radscheduler background color

9 posts, 0 answers
  1. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 16 Mar 2009 Link to this post

    Hi,

    Since upgrading to 209 Q1 release the following code no longer works:

    If ProjectID = "0" Or ProjectID = "" Then  
                e.Appointment.BackColor = Drawing.Color.Silver  
            Else  
                e.Appointment.BackColor = Drawing.Color.DarkSeaGreen  
                If Leave = "True" Then  
                    e.Appointment.BackColor = Drawing.Color.Khaki  
                Else  
                    If OutOfOffice = "True" Then  
                        e.Appointment.BackColor = Drawing.Color.Wheat  
                        e.Appointment.Font.Bold = True 
                        e.Appointment.ForeColor = Color.Red  
                    Else  
                        e.Appointment.BackColor = ColorTranslator.FromOle(RGB(216, 229, 154))  
                    End If  
                End If  
            End If 

    The bold and font color work OK, but the backcolor no longer seems to work in this release.

    David Penny.

  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 18 Mar 2009 Link to this post

    Hello David,

    With Q1 2009, we use background images from sprites for the appointments' background. If you want to use custom color for the appointments, you have to remove the background image with the following css rules:
     <style type="text/css">     
        .RadScheduler .rsAptContent,   
        .RadScheduler .rsAptIn,   
        .RadScheduler .rsAptMid,   
        .RadScheduler .rsAptOut   
        {          
            background-imagenone !important;  
        }  
        </style> 
      
    and set the BackColor property from code:
      protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)  
        {  
            e.Appointment.BackColor = System.Drawing.Color.Red;          
        } 

    If your appointments have resources associated with them, you could use the new ResourceStyleMapping feature and set up to 4 unique styles (rsCategoryBlue, rsCategoryOrange, rsCategoryRed, rsCategoryGreen) in addition to the default one. The background images for these styles are embedded in the skins so you don't have to create them. The following example demonstrates this:
    http://demos.telerik.com/aspnet-ajax/scheduler/examples/resources/defaultcs.aspx
     <ResourceStyles> 
                        <telerik:ResourceStyleMapping Type="User" Text="Alex" ApplyCssClass="rsCategoryBlue" /> 
                        <telerik:ResourceStyleMapping Type="User" Text="Bob" ApplyCssClass="rsCategoryOrange" /> 
                        <telerik:ResourceStyleMapping Type="User" Text="Charlie" ApplyCssClass="rsCategoryGreen" /> 
                    </ResourceStyles> 
     

    You can also see this blog post:
    http://blogs.telerik.com/tervelpeykov/posts/09-02-23/RadControls_for_ASP_NET_AJAX_receive_a_major_face-lift.aspx


    Regards,
    Peter
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 18 Mar 2009 Link to this post

    Peter,

    Thanks for that.  But after doing it, I decided I liked the new look of the Scheduler too much to change it, so I'm going to stick with different foreground colours instead.

    David Penny
  5. Marty
    Marty avatar
    61 posts
    Member since:
    Oct 2008

    Posted 18 Mar 2009 Link to this post

    This worked for me!  I had similiar code from Q3 2008, but it looks like a few items were added as well as the '!important' tag.  Either way, once I converted to this code, background images are no longer displayed on my appointments.

    Thanks!

    Marty
  6. Eric
    Eric avatar
    3 posts
    Member since:
    Mar 2009

    Posted 20 Mar 2009 Link to this post

    Hi,

    I added the CSS from your post to my stylesheet and set the cssclass of the radscheduler to RadScheduler but the images were not removed. Is there something more I need to do?

    I find this very frustrating! Seems I have been trying to remove the background now for hours!

    Thanks,
    Eric
  7. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 22 Mar 2009 Link to this post

    Hi Eric,

    Please, do not sec the CssClass property of RadScheduler. The "RadScheduler" class is applied by default and its definition comes from the base css file for RadScheduler. setting the CssClass of RadScheduler adds additional class which makes the suggested css selectors invalid.


    Kind regards,
    Peter
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  8. Eric
    Eric avatar
    3 posts
    Member since:
    Mar 2009

    Posted 23 Mar 2009 Link to this post

    Thanks peter. That helped!

  9. Nick
    Nick avatar
    11 posts
    Member since:
    Jan 2009

    Posted 23 May 2009 Link to this post

    Will there eventually be support for more than 4 styles for use with the ResourceStyleMapping? Is there a workaround to be able to use all 10 category styles?

    Thanks
  10. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 25 May 2009 Link to this post

    Hi Nick,

    Yes, now we provide 10 appointment styles which you can use out-of-the-box. Please, see this help topic: http://www.telerik.com/help/aspnet-ajax/appearance-setting-appointment-style.html


    Cheers,
    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017