Scheduler for WinForms | ComponentOne
Scheduler Control / Appointments / Categories / Adding Custom Categories to the Master Category List
In This Topic
    Adding Custom Categories to the Master Category List
    In This Topic

    C1Schedule also supports custom categories created in code or at run time through the Master Category List dialog box. The following code, added to the Form_Load event, creates a custom Meetings category:

    C#
    Copy Code
    // Create the Meetings category.       
    C1.C1Schedule.CategoryCollection catcol;
    catcol = this.c1Schedule1.DataStorage.CategoryStorage.Categories;
    C1.C1Schedule.Category meetings = new C1.C1Schedule.Category();
    meetings.Text = "Meetings";
    // Insert the Meetings category into the Master Category List.       
    catcol.Insert(0, meetings);
    category = this.c1Schedule1.DataStorage.CategoryStorage.Categories[0];
    app1.Categories.Add(category);
    

    At run time, creating a custom category or categories can be done through the Master Category List dialog box. Clicking the Master Category List button in the Categories dialog box opens the Master Category List dialog box where you add, remove, or reset categories.

    After you create a custom category or categories, add the categories to the appointment in the Categories dialog box the same way you would add a predefined category. For more details on how to add a category to an appointment, see Assigning Predefined Categories to an Appointment.