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

Add a diferent category colors

3 Answers 164 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
jose
Top achievements
Rank 1
jose asked on 09 Jun 2011, 07:51 PM
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???

3 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 10 Jun 2011, 08:28 AM
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
0
Supreet
Top achievements
Rank 1
answered on 02 Aug 2011, 04:22 PM
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
0
Dani
Telerik team
answered on 03 Aug 2011, 09:22 AM
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 >>
Tags
ScheduleView
Asked by
jose
Top achievements
Rank 1
Answers by
Dani
Telerik team
Supreet
Top achievements
Rank 1
Share this question
or