ComponentOne EventsCalendar for ASP.NET Web Forms
Working with EventsCalendar for ASP.NET Web Forms / Views / Changing the View
In This Topic
    Changing the View
    In This Topic

    You can change the data view of a C1EventsCalendar control at design time using Source view, Properties window, and in Code.

    Complete the following steps to set the ViewType property to Month:

    In Source View

    Switch to Source view and add ViewType="Month" to the <cc1:C1EventsCalendar> tag so that it appears similar to the following:

    <cc1:C1EventsCalendarID="C1EventsCalendar1" runat="server"
        ViewType="Month">
    

    In the Properties Window

    1. Click the C1EventsCalendar control to select it.
    2. Navigate to the Visual Studio Properties window and locate the View property.
    3. Click the ellipsis button (...) next to Views property to open the View Collection Editor.
    4. Go to member Months, set IsActive to True.
    5. Click the drop-down of Type property and select Month.

    In Code

    Add the following code to the Page_Load event to set the calendar's ViewType to Month:

    Visual Basic
    Copy Code
     C1EventsCalendar1.Views[2].IsActive = true
    


    C#
    Copy Code
     C1EventsCalendar1.Views[2].IsActive = true;
    

    What You've Accomplished

    When you run the project, EventsCalendar appears as shown in the image below.

    See Also