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

[Solved] how to set the CSS per User?

11 Answers 219 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Raul
Top achievements
Rank 1
Raul asked on 02 Apr 2009, 11:17 PM
Hi,
i need to have different color per user resource, i went through the example and it doesnt seem to work, i looked at the ALEX,.BOB,Charlie example on web but i cant quit understand it. can someone show me instruction how i can have a unique color per user resource? ( i have already defined my users and its working well).

Thank you,

11 Answers, 1 is accepted

Sort by
0
Raul
Top achievements
Rank 1
answered on 03 Apr 2009, 04:49 PM
noone here knows the answer????
0
Yana
Telerik team
answered on 06 Apr 2009, 02:16 PM
Hello Raul,

In the online example the different styles for the user resources are set declaratively like this:

<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>

Kind regards,
Yana
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Raul
Top achievements
Rank 1
answered on 06 Apr 2009, 04:40 PM
Thank you for explanation however i still have problem, here is my code

<ResourceStyles>
             <telerik:ResourceStyleMapping Type="User" Text="Joe Smith" ApplyCssClass="StyleSheet" />
</ResourceStyles>

then i have a file in my project called StyleSheet.css
and the content is :

background: Green

but still i get the yellow background.

any help is appreciated.



0
Raul
Top achievements
Rank 1
answered on 07 Apr 2009, 11:05 PM
from what i understand these CSS files are built in:
rsCategoryOrange

so i dont technically need a CSSfile, but it doesnt seem to work, perhaps i need to register something? these controls are great but i wish the documentation or help response time were abit better.

Thank you,


0
Yana
Telerik team
answered on 08 Apr 2009, 12:58 PM
Hello Raul,

You're right, I'm sorry I didn't explain this.

There are 10 built-in styles you can use for appointments' background:  rsCategoryBlue, rsCategoryRed, rsCategoryGreen , rsCategoryOrange, rsCategoryPink  ,rsCategoryYellow, rsCategoryViolet, rsCategoryDarkRed , rsCategoryDarkGreen, rsCategoryDarkBlue. 

You just need to set them to ApplyCssClass property.
 

Regards,
Yana
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Peter
Telerik team
answered on 08 Apr 2009, 01:03 PM

We have just created a help topic on setting appointment styles which explains in details how this is achieved. The help topic is not live yet so I am sending you the content as a MS word document. We will appreciate any feedback your provide us on it.  

All the best,
Peter
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Raul
Top achievements
Rank 1
answered on 08 Apr 2009, 04:00 PM
Thank you for the file, but i think there is something missing, can we walk through the steps ?
1-) create a new project in VS 2008
2-) drag the Rad Scheduler
3-) define your data source
4-) add your resources
so far things are working, then when i do resourcemapping nothing takes effect, its just as if i didnt apply anything.
how does it know where to look for the png files? dont i need to copy them to my project? where in the project? what i suggest is you start VS 2008 and try to do this using resoursestyle mapping, and then make the steps from that. because based on the help pdf it does not work. as i said i assume it needs more steps which i am missing but no documentation points to them.

Thank you,
0
Raul
Top achievements
Rank 1
answered on 08 Apr 2009, 04:22 PM
Update: i tried to use the custom CSS stype you have in your word, it doesnt still work !!
i created a fold "Scheduler" in my project root and copied all the PNG file to that
then in my default.aspx
i added this code in the <head> section

<style type="text/css">
    .RadScheduler .MyCustomAppointmentStyle .rsAptContent,
    .RadScheduler .MyCustomAppointmentStyle .rsAptMid .rsAptIn,
    .RadScheduler .MyCustomAppointmentStyle .rsAptMid,
    .RadScheduler .MyCustomAppointmentStyle .rsAptOut
    {
     background-image: url('~/Scheduler/rsAppointmentBlueBg.png');
    }
    .RadScheduler .MyCustomAppointmentStyle .rsAptContent
    {
     /*font style*/
     color: Blue;
    }
</style>

then in my defaultCS.CS file i added this code
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)
    {
        e.Appointment.CssClass = "MyCustomAppointmentStyle";
    }


}

i even added this to my aspx:
            <ResourceStyles>
                <telerik:ResourceStyleMapping ApplyCssClass="MyCustomAppointmentStyle"  
                    Text="Test" Type="User" />
            </ResourceStyles>

still nothing !!! it keeps putting the default gray background.

Any Help is appreciated.







0
Raul
Top achievements
Rank 1
answered on 08 Apr 2009, 04:45 PM
after playing with it further, i noticed if i set this code in <head>
<style type="text/css">     
    .RadScheduler .rsAptContent,   
    .RadScheduler .rsAptIn,   
    .RadScheduler .rsAptMid,   
    .RadScheduler .rsAptOut   
    {          
        background-image: url('Scheduler/rsAppointmentBlueBg.png') !important;  
    }  
    </style>
it does change the background for "ALL" appointments,
i am really confused now. seems like the customCSS is not working
0
Raul
Top achievements
Rank 1
answered on 08 Apr 2009, 10:44 PM
Problem Solved ! sorry for all the posts, but thought if someone is having the same problem as me
in your documentation on how to setup the resourses, you name the resources "Users" yet in all your examples you use "User" thus why i was using using user !!! so correct syntax is :

            <ResourceStyles>
                <telerik:ResourceStyleMapping ApplyCssClass="MyCustomAppointmentStyle"  
                    Text="Test" Type="Users" />
            </ResourceStyles>

also you mention there are 10 built in CSS, but in Scheduler.css there is only definition for 3. ( rsCategoryBlue Orange and Green)

Thanks for the help,
0
Accepted
Yana
Telerik team
answered on 09 Apr 2009, 07:49 AM
Hi Raul,

Thank you for the feedback.

In our latest release Q1 SP1 there are 10 built-in appointments styles, I suppose that you're using Q1 release where they were only 3.

Best wishes,
Yana
the Telerik team

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