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

CategoryHelper is not available in RadSchedulerView?

1 Answer 36 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Kotte
Top achievements
Rank 1
Kotte asked on 01 Sep 2011, 02:58 PM
Hi Telerik,

Is there any way I can pull the category by name.This feature is available in Scheduler.


public static Category RecreateCategory(string categoryName)
        {
            return Categories.AllCategories.SingleOrDefault(c => c.CategoryName == categoryName);
        }

1 Answer, 1 is accepted

Sort by
0
Kotte
Top achievements
Rank 1
answered on 01 Sep 2011, 04:05 PM

Hi ,

I fixed the issue.

public class CategoryHelper
    {
        public static Category RecreateCategory(string categoryName)
        {
            Category category = null;            
            switch (categoryName)
            {
                case "Red Category":
                    category = new Category("Red Category", new SolidColorBrush(Colors.Red));
                    break;
                case "Orange Category":
                    category = new Category("Orange Category", new SolidColorBrush(Colors.Orange));
                    break;
                case "Green Category":
                    category = new Category("Green Category", new SolidColorBrush(Colors.Green));
                    break;
                case "Blue Category":
                    category = new Category("Blue Category", new SolidColorBrush(Colors.Blue));
                    break;
                case "Purple Category":
                    category = new Category("Purple Category", new SolidColorBrush(Colors.Purple));
                    break;
                case "Yellow Category":
                    category = new Category("Yellow Category", new SolidColorBrush(Colors.Yellow));
                    break;
                case "Olive Category":
                    category = new Category("Olive Category", new SolidColorBrush(Colors.Brown));
                    break;
                case "Pink Category":
                    category = new Category("Pink Category", new SolidColorBrush(Colors.Red));
                    break;
                default:
                    category = new Category("White Category", new SolidColorBrush(Colors.White));
                    break;
            }
            return category;
        }
        public static string MakeCategoryString(ICategory category)
        {
            return category == null ? String.Empty : category.CategoryName;
        }


    }
Tags
ScheduleView
Asked by
Kotte
Top achievements
Rank 1
Answers by
Kotte
Top achievements
Rank 1
Share this question
or