Add a diferent category colors

4 posts, 0 answers
  1. jose
    jose avatar
    7 posts
    Member since:
    Sep 2010

    Posted 09 Jun 2011 Link to this post

    Hi.

    I´m workin with scheduler  control, and i´m using a diferen category colors  for a dirferen user.  the app Sherduler of Relerik only have a 8  default colors but a   need a  a more  Catergory with a diferent colors.

    To add a new category at sheduler, my code is like it;

    radScheduler.Categories.Add(

     

    new Category("Magenta Category", new SolidColorBrush(Colors.Magenta)));

     

     

    in the runTime this no have Problem. I can see the  Magenta Category

    The problem is when I  create a new Appointment whit Magenta Category, in runTime I can See  the new Appointments  whit  Magenta Category. but when I refresh the app  this new  Appointments is Shown withuot Category.

    I'm using a WCF to save the Appointments, and i´ve a table with columns name "Categoy" an hare save the name of the corresponding category. what i can do???
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 10 Jun 2011 Link to this post

    Hello Jose,

    Please, take the time to examine the FirstLook example of RadScheduleView. It demonstrates a very simple way to create a custom collection of Categories. Simply add your desired categories to the CategoryCollection:

    <schedule:RadScheduleView.CategoriesSource>
                    <schedule:CategoryCollection>
                        <schedule:Category CategoryName="Green" CategoryBrush="{StaticResource GreenBrush}" />
                        <schedule:Category CategoryName="Purple" CategoryBrush="{StaticResource PurpleBrush}" />
                        <schedule:Category CategoryName="Olive" CategoryBrush="{StaticResource OliveBrush}" />
                        <schedule:Category CategoryName="Pink" CategoryBrush="{StaticResource PinkBrush}" />
                    </schedule:CategoryCollection>
      </schedule:RadScheduleView.CategoriesSource>

    I hope this helps in your case. Let me know if this approach does not fit your scenario.

    All the best,
    Dani
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Supreet
    Supreet avatar
    19 posts
    Member since:
    Mar 2011

    Posted 02 Aug 2011 Link to this post

    Hi,
       How do we set Category Colors to Appointments dynamically?
    with RadScheduler it was possible to do something like
     case "Blue Category":
                                newAppointment.Category = Categories.BlueCategory;
                                break;
                            case "Green Category":
                                newAppointment.Category = Categories.GreenCategory;
                                break;

    will this be possible using RadScheduleView?
    Thanks & Regards
    Supreet
  4. Dani
    Admin
    Dani avatar
    848 posts

    Posted 03 Aug 2011 Link to this post

    Hello Supreet,

    When adding an appoitnment dynamically, you can set its category in the following manner:
    new Appointment(){Subject="April",Start =DateTime.Today,End =DateTime.Today.AddHours(4), Category = new Category (){CategoryBrush= Brushes.Red, CategoryName="Red"}},

    It is best if you have your own category collection and set choose an element from it, when creating the appoitnment.

    I hope this helps.


    Best wishes,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Back to Top