By default, the format of C1Calendar's title is set to display the full month title and all four digits of the year. This calendar can also display an abbreviated calendar month name and full year (for example, Mar 2009) or the calendar month and year in digits (for example, 03-2009). In this topic, you will learn how to set the format of the title in Design view, in Source view, and in code. This topic assumes that you have created an AJAX-enabled ASP.NET project that contains a ScriptManager control (see Creating an AJAX-Enabled ASP.NET Project) and a C1Calendar control.
In Design View
Complete the following steps:
1. Click the Design tab to enter Design view.
2. Right-click the C1Calendar control to open its context menu and then select Properties.
The Properties window opens with C1Calendar's properties in focus.
3. In C1Calendar's Properties window, click the drop-down button in the CalendarTitle property to open the list of custom date format patterns.
4. Select one of the following formats from the list. For the purpose of this tutorial, select {0:MM-yyyy}.
The calendar title changes to the format you specified.
In Source View
Complete the following steps:
1. Click the Source tab to enter Source view.
2. Add CalendarTitle="{0:MM-yyyy}" to the <cc1:C1Calendar> tag so that the markup resembles the following:
<cc1:C1Calendar ID="C1Calendar1" runat="server" CalendarTitle="{0:MM-yyyy}">
3. Click the Design tab to enter Design view and observe that the calendar title has changed to the format you specified.
In Code View
Complete the following steps:
1. In Design view, double click the page to enter Code view. This will also add a Page_Load event to your project.
2. Place the following code in the Page_Load event:
C1Calendar1.CalendarTitle = "{0:MM-yyyy}"
•C#
C1Calendar1.CalendarTitle = "{0:MM-yyyy}";
3. Open the project and observe that the calendar title has changed to the format you specified.
This Topic
Illustrates the Following:
The following image depicts a C1Calendar control with the title format {0:MM-yyyy} format.