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

Radscheduler background color

8 Answers 689 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
David Penny
Top achievements
Rank 2
David Penny asked on 16 Mar 2009, 01:51 PM
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.

8 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 18 Mar 2009, 01:44 PM
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.
0
David Penny
Top achievements
Rank 2
answered on 18 Mar 2009, 03:51 PM
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
0
Marty
Top achievements
Rank 1
answered on 18 Mar 2009, 07:51 PM
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
0
Eric
Top achievements
Rank 1
answered on 20 Mar 2009, 03:52 PM
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
0
Peter
Telerik team
answered on 22 Mar 2009, 12:53 PM
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.
0
Eric
Top achievements
Rank 1
answered on 23 Mar 2009, 02:20 PM
Thanks peter. That helped!

0
Nick
Top achievements
Rank 1
answered on 24 May 2009, 02:35 AM
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
0
Peter
Telerik team
answered on 25 May 2009, 03:19 PM
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.
Tags
Scheduler
Asked by
David Penny
Top achievements
Rank 2
Answers by
Peter
Telerik team
David Penny
Top achievements
Rank 2
Marty
Top achievements
Rank 1
Eric
Top achievements
Rank 1
Nick
Top achievements
Rank 1
Share this question
or