Applying Custom Formats to the Calendar Title

In addition to the built-in date format patterns, you can apply custom date format patterns to customize your calendar title or month view title. C1Calendar supports all date format patterns, so you can apply any date format pattern to the CalendarTitle property. 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.   In C1Calendar's Properties window, set the CalendarTitle property to "{0:MM-yy}" .

The custom date format pattern appears on the calendar title.

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-yy}">

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:

      Visual Basic

      C#

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 a custom title format.

 


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.