Selecting Dates

You can select dates within the C1Calendar control at design-time so that they will already be selected upon page load. This topic illustrates how to set selected dates in Design view and in Source view. 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.   Right-click the C1Calendar control and select Properties.

2.   In C1Calendar's Properties window, select the SelectedDates property and click the ellipsis button . The C1Date Collection Editor appears.

3.   In the C1Date Collection Editor dialog box, complete the following tasks:

a.   Click Add twice to add two selected dates to the calendar.

b.   Select the first selected date and set its Date property to “3/9/2009”.

c.    Select the second selected date and set its Date property to “3/10/2009”.

4.   Open the project in a Studio for iPhone-compatible browser.

5.   Use the calendar's navigation buttons to navigate to March of 2009 in the calendar and observe that the 9th and the 10th of the month are selected.

In Source View

Complete the following steps:

1.   Click the Source tab to switch to Source view.

2.   Place the following markup between the <cc1:C1Calendar> and </cc1:C1Calendar> tags:

<SelectedDates>

    <cc1:C1Date Date="2009-03-09" />

    <cc1:C1Date Date="2009-03-10" />

</SelectedDates>

3.   Open the project in a Studio for iPhone-compatible browser.

4.   Use the calendar's navigation buttons to navigate to March of 2009 in the calendar and observe that the 9th and the 10th of the month are selected.

In Code

Complete the following steps:

1.   Import the following namespaces into your project:

      Visual Basic

      C#

2.   Add the following code to the Page_Load event to select the dates:

      Visual Basic

      C#

3.   Open the project in a Studio for iPhone-compatible browser.

4.   Use the calendar's navigation buttons to navigate to March of 2009 in the calendar and observe that the 9th and the 10th of the month are selected.

 This Topic Illustrates the Following:

The following image shows a C1Calendar with March 9th and March 10th selected:

 

 


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