componentone scheduler for asp.net ajax · 1 componentone scheduler for asp.net ajax overview...

89
ComponentOne Scheduler for ASP.NET AJAX

Upload: duongthien

Post on 10-Sep-2018

242 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

ComponentOne

Scheduler for ASP.NET AJAX

Page 2: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

Copyright 2011 ComponentOne LLC. All rights reserved.

Corporate Headquarters ComponentOne LLC 201 South Highland Avenue 3rd Floor

Pittsburgh, PA 15206 ∙ USA

Internet: [email protected]

Web site: http://www.componentone.com

Sales

E-mail: [email protected]

Telephone: 1.800.858.2739 or 1.412.681.4343 (Pittsburgh, PA USA Office)

Trademarks

The ComponentOne product name is a trademark and ComponentOne is a registered trademark of ComponentOne LLC. All other trademarks used herein are the properties of their respective owners.

Warranty

ComponentOne warrants that the original CD (or diskettes) are free from defects in material and workmanship, assuming normal use, for a period of 90 days from the date of purchase. If a defect occurs during this time, you may return the defective CD (or disk) to ComponentOne, along with a dated proof of purchase, and ComponentOne will replace it at no charge. After

90 days, you can obtain a replacement for a defective CD (or disk) by sending it and a check for $25 (to cover postage and handling) to ComponentOne.

Except for the express warranty of the original CD (or disks) set forth here, ComponentOne makes no other warranties, express or implied. Every attempt has been made to ensure that the information contained in this manual is correct as of the time it was

written. We are not responsible for any errors or omissions. ComponentOne’s liability is limited to the amount you paid for the product. ComponentOne is not liable for any special, consequential, or other damages for any reason.

Copying and Distribution

While you are welcome to make backup copies of the software for your own use and protection, you are not permitted to make

copies for the use of anyone else. We put a lot of time and effort into creating this product, and we appreciate your support in seeing that it is used by licensed users only.

This manual was produced using ComponentOne Doc-To-Help™.

Page 3: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

iii

Table of Contents

ComponentOne Scheduler for ASP.NET AJAX Overview ..............................................................................1

What's New in Scheduler for ASP.NET AJAX ............................................................................................. 1

Revision History............................................................................................................................................. 1

What's New in 2011 v1..................................................................................................................... 1

What's New in 2010 v3..................................................................................................................... 2

What's New in 2010 v2..................................................................................................................... 3

Installing Scheduler for ASP.NET AJAX...................................................................................................... 4

Scheduler for ASP.NET AJAX Setup Files ..................................................................................... 4

System Requirements ....................................................................................................................... 5

Installing Demonstration Versions ................................................................................................... 5

Uninstalling Scheduler for ASP.NET AJAX ................................................................................... 6

Deploying your Application in a Medium Trust Environment ....................................................... 6

End-User License Agreement ........................................................................................................................ 9

Licensing FAQs ............................................................................................................................................. 9

What is Licensing?............................................................................................................................ 9

How does Licensing Work?.............................................................................................................. 9

Common Scenarios ........................................................................................................................ 10

Troubleshooting.............................................................................................................................. 12

Technical Support ........................................................................................................................................ 14

Redistributable Files ..................................................................................................................................... 14

About this Documentation........................................................................................................................... 15

Namespaces.................................................................................................................................................. 15

Creating an AJAX-Enabled ASP.NET Project............................................................................................ 16

Adding the C1Schedule Component to a Project ........................................................................................ 18

Scheduler for ASP.NET AJAX Key Features ............................................................................................... 21

Scheduler for ASP.NET AJAX Quick Start .................................................................................................. 23

Step 1 of 3: Adding C1Schedule to the Project ............................................................................................ 23

Step 2 of 3: Customizing the Schedule ......................................................................................................... 24

Step 3 of 3: Adding an Appointment at Run Time ...................................................................................... 25

Design-Time Support in Scheduler for ASP.NET AJAX ............................................................................... 29

Page 4: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

iv

C1Schedule Smart Tag ................................................................................................................................. 29

C1Schedule Context Menu .......................................................................................................................... 31

C1Schedule Properties Window .................................................................................................................. 32

Scheduler for ASP.NET AJAX Top Tips ..................................................................................................... 33

Working with Scheduler for ASP.NET AJAX .............................................................................................. 34

Data and Databinding .................................................................................................................................. 34

Data Mappings ............................................................................................................................... 35

Binding C1Schedule to a Data Source ........................................................................................... 37

Using the Built-in Data Storage ...................................................................................................... 38

Appointments ............................................................................................................................................... 39

Recurrence ...................................................................................................................................... 40

Labels.............................................................................................................................................. 43

Availability Status .......................................................................................................................... 44

Reminders ....................................................................................................................................... 45

Contacts .......................................................................................................................................... 46

Categories ....................................................................................................................................... 50

Resources ........................................................................................................................................ 55

Data Views ................................................................................................................................................... 60

Changing the Data View ................................................................................................................ 64

Visual Styles ................................................................................................................................................. 65

Changing the Visual Style .............................................................................................................. 67

Customizing the Control's Appearance .......................................................................................... 68

Client-Side Functionality in Scheduler for ASP.NET AJAX .......................................................................... 68

Client-Side Properties ................................................................................................................................... 69

Client-Side Events ........................................................................................................................................ 69

Scheduler for ASP.NET AJAX Samples ...................................................................................................... 71

Scheduler for ASP.NET AJAX Task-Based Help .......................................................................................... 71

Customizing C1Schedule's Appearance ....................................................................................................... 71

Changing the Start Date of the Schedule in DayView ................................................................... 71

Changing the Culture of a Schedule ............................................................................................... 72

Hiding the Navigation Bar ............................................................................................................. 73

Hiding the Status Bar...................................................................................................................... 74

Hiding the View Selection Bar ....................................................................................................... 74

Working with Appointments at Run Time .................................................................................................. 75

Adding an Appointment ................................................................................................................. 75

Page 5: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

v

Deleting an Appointment ............................................................................................................... 75

Creating a Recurring Appointment ................................................................................................ 76

Printing an Appointment ................................................................................................................ 76

Changing the Time within the Appointment Dialog Box .............................................................. 76

Adding Keyboard Support ........................................................................................................................... 77

Disabling the Reminder Form ..................................................................................................................... 77

Importing and Exporting Schedule Data ..................................................................................................... 78

Using C1Schedule with C1Calendar............................................................................................................ 80

Client-Side Tasks .......................................................................................................................................... 81

Getting and Setting the Display Date in Day View ....................................................................... 81

Adding Previous and Next Navigation .......................................................................................... 82

Page 6: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar
Page 7: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

1

ComponentOne Scheduler for

ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full

scheduling functionality with the familiar look of Microsoft OutlookTM. Display shared or private appointment calendars in day, week, work week, or monthly views, complete with appointment pop-up reminders, labels, and availability status. C1Schedule also manages contacts, categories, and resources to

help you stay organized. With C1Schedule's built-in data layer, easily save and load data, either from a bound or built-in data

source.

Offering ASP.NET AJAX (1.0 and later) compatibility and a rich client-side object model, C1Schedule allows you to deliver a responsive UI, optimizing performance in your Web applications for a smooth user experience.

Getting Started

Get started with the following topics:

- Key Features (page

21)

- Quick Start (page 23)

- Samples (page 71)

What's New in Scheduler for ASP.NET AJAX The following new features were added to ComponentOne Scheduler for ASP.NET AJAX in the 2011 v2 release:

Time Ruler Format

Specify the format of the time ruler for the Day or HorizontalWeek view with the new TimeRulerFormat property.

Time Interval

Specify the time interval for displaying the time slots in the DayView mode with the new TimeInterval property. Built-in intervals range from five minutes to one hour.

Highlighted Date

Now when you set an appointment in a C1Schedule control the date in a linked C1Calendar control will be highlighted.

Tip: A version history containing a list of new features, improvements, fixes, and changes for each product is available on HelpCentral at http://helpcentral.componentone.com/VersionHistory.aspx.

Revision History The revision history details recent enhancements to Scheduler for ASP.NET AJAX.

What's New in 2011 v1

No new features were added or enhancements made to ComponentOne Scheduler for ASP.NET AJAX in the

2011 v1 release.

Page 8: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

2

What's New in 2010 v3

New features and class members were added to ComponentOne Scheduler for ASP.NET AJAX in the 2010 v3

release.

Spanish Translation

The distribution now includes Spanish translation.

Extended EventArgs

The CancelableAppointmentEventArgs was extended to include appointment data that was populated in the browser. This property returns null in the BeforeAppointmentDelete event.

New Members

Several new members were added to the CancelableAppointmentEventArgs and ClientAppointmentData classes.

New Members

The following new properties were added to ComponentOne Scheduler for ASP.NET AJAX in the 2010 v3 release:

Class Property Description

CancelableAppointmentEventAr

gs

Appointment The Appointment object to be updated.

CancelEvent Set this property to True if you want to cancel the action that called this event.

ClientData The appointment information that was received

from client. Note, this property returns null for the BeforeAppointmentDelete event.

ClientAppointmentData AllDayEvent Is an all-day event appointment. Used by

SaveAppointmentCommand.

Body Gets the String value representing the body of the

Appointment object.

BusyStatus Gets or sets the Status object indicating the busy status of the user for the appointment.

Categories Gets the Category List which holds the set of categories assigned to the appointment. Categories

may be associated with an appointment to

effectively group appointments. An appointment

may be associated with multiple categories.

Duration Duration in minutes. Used by UpdateAppointmentLocationCommand /

SaveAppointmentCommand.

HasAllDayEvent The AllDayEvent value specified by client.

HasBody The Body value specified.

HasBusyStatus The BusyStatus value specified by client.

HasCategories The Categories value specified by client.

HasDuration The Duration value specified.

Page 9: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

3

HasLabel The Label value specified by client.

HasLinks The Links value specified by client.

HasLocation The Location value specified.

HasPrivate The Private value specified.

HasSnoozeTime The SnoozeTime value specified.

HasSubject The Subject value specified.

HasRecurrenceSta

te

The RecurrenceState value specified.

HasReminderTime

BeforeStart

The ReminderTimeBeforeStart value specified.

HasReminderSet The ReminderSet value specified.

HasResources The Resources value specified by client.

HasStartDate The StartDate value specified.

Label Gets the Label object associated with the appointment.

Links Gets the Contact List which holds the set of

Contact objects for this appointment. An appointment may be associated with multiple

contacts.

Location Gets the Location value of the appointment.

Private Gets the Boolean value determining whether the

calendar owner intends to keep the Appointment object private.

RecurrenceState Gets the RecurrenceStateEnum value indicating

the recurrence state of the appointment.

ReminderSet Gets the Boolean value indicating whether a

reminder is associated with the appointment.

Resources Gets the Resource List which holds the set of Resource objects for this appointment. An

appointment may be associated with multiple

resources.

ReminderTimeBeforeStart

Gets the TimeSpan value indicating the interval of time the reminder should occur prior to the start of

the appointment.

StartDate Gets the DateTime value determining the start date and time of the appointment.

Subject Gets the Subject value of the appointment.

What's New in 2010 v2

New features and class members supporting dialog box customization were added to ComponentOne Scheduler

for ASP.NET AJAX in the 2010 v2 release.

Page 10: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

4

New Members

The C1ScheduleDialogEventArgs class was extended with the Appointment, DialogType, and Window properties. The DialogType enumeration was added to indicate the dialog box type.

New Sample

The C1Schedule OnClientBeforeDialogOpen sample was added to the Scheduler for ASP.NET AJAX

installation in the 2010 v2 release. This sample demonstrates how to replace the built-in EditAppointment dialog box with a custom dialog box using the OnClientBeforeDialogOpen event.

New Members

The following new class was added to ComponentOne Scheduler for ASP.NET AJAX in the 2010 v2 release:

Class Description

DialogType Represents the dialog box type. Options include: AddNewAppointment = 1, EditAppointment = 2, Contacts = 3, Categories = 4, EditResources =

5, EditCategories = 6, EditContacts = 7, Reminder = 8, Resources = 9, Recurrence = 10.

The following new properties were added to ComponentOne Scheduler for ASP.NET AJAX in the 2010 v2

release:

Class Property Description

C1ScheduleDialogEventArgs Appointment Gets the appointment object, instance of the C1Appointment client class.

DialogType Gets the type of the dialog box.

Window Gets the dialog window.

Installing Scheduler for ASP.NET AJAX The following sections provide helpful information on installing ComponentOne Scheduler for ASP.NET AJAX.

Scheduler for ASP.NET AJAX Setup Files

The ComponentOne Studio for ASP.NET AJAX installation program will create the following directory:

C:\Program Files\ComponentOne\Studio for ASP.NET. This directory contains the following subdirectories:

Bin Contains copies of all binaries (DLLs, Exes) in the ComponentOne Visual Studio ASP.NET package.

C1WebUi Contains files (at least a readme.txt) related to the product.

C1WebUi\VisualStyles Contains all external file themes.

The ComponentOne Studio for ASP.NET AJAX Help Setup program installs integrated Microsoft Help 2.0 and Microsoft Help Viewer help to the C:\Program Files\ComponentOne\Studio for ASP.NET directory in the following folders:

H2Help Contains Microsoft Help 2.0 integrated documentation for all Studio components.

Page 11: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

5

HelpViewer Contains Microsoft Help Viewer Visual Studio 2010 integrated documentation for all Studio components.

Samples

Samples for the product are installed in the ComponentOne Samples folder by default. The path of the ComponentOne Samples directory is slightly different on Windows XP and Windows Vista machines:

Windows XP path: C:\Documents and Settings\<username>\My Documents\ComponentOne Samples

Windows Vista path: C:\Users\<username>\Documents\ComponentOne Samples

The ComponentOne Samples folder contains the following subdirectories:

Common Contains support and data files that are used by many of the demo programs.

Studio for ASP.NET\C1WebUi

Contains samples and tutorials for Studio for ASP.NET AJAX.

Samples can be accessed from the ComponentOne Sample Explorer. To view samples, on your desktop, click the

Start button and then click All Programs | ComponentOne | Studio for ASP.NET | Samples | Palomino

Samples.

System Requirements

System requirements include the following:

Operating Systems: Windows 2000

Windows Server 2003

Windows Server 2008

Windows XP SP2

Windows Vista™

Web Server: Microsoft Internet Information Services (IIS) 6.x

Environments: NET Framework 2.0 or later

C# .NET

Visual Basic .NET

ASP.NET

Internet Explorer 6.0 or later

Firefox® 2.0 or later

Safari 2.0 or later

Disc Drive: CD or DVD-ROM drive if installing from CD

Installing Demonstration Versions

If you wish to try Scheduler for ASP.NET AJAX and do not have a serial number, follow the steps through the installation wizard, and use the default serial number.

Page 12: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

6

The only difference between unregistered (demonstration) and registered (purchased) versions of our products is that registered versions will stamp every application you compile so a ComponentOne banner will not appear when your users run the applications.

Uninstalling Scheduler for ASP.NET AJAX

To uninstall Studio for ASP.NET AJAX:

1. Open the Control Panel and select Add or Remove Programs (Programs and Features Windows 7/Vista).

2. Select ComponentOne Studio for ASP.NET and click the Remove button.

3. Click Yes to remove the program.

To uninstall Studio for ASP.NET AJAX integrated help:

1. Open the Control Panel and select Add or Remove Programs (Programs and Features in Windows 7/Vista).

2. Select ComponentOne Studio for ASP.NET AJAX Help and click the Remove button.

3. Click Yes to remove the integrated help.

Deploying your Application in a Medium Trust Environment

Depending on your hosting choice, you may need to deploy your Web site or application in a medium trust environment. Often in a shared hosting environment, medium trust is required. In a medium trust environment

several permissions are unavailable or limited, including OleDbPermission, ReflectionPermission, and FileIOPermission. You can configure your Web.config file to enable these permissions.

Note: ComponentOne controls will not work in an environment where reflection is not allowed.

ComponentOne ASP.NET controls include the AllowPartiallyTrustedCallers() assembly attribute and will work under the medium trust level with some changes to the Web.config file. Since this requires some control over the Web.config file, please check with your particular host to determine if they can provide the rights to override these security settings.

Modifying or Editing the Config File

In order to add permissions, you can edit the exiting web_mediumtrust.config file or create a custom policy file based on the medium trust policy. If you modify the existing web_mediumtrust.config file, all Web applications will have the same permissions with the permissions you have added. If you want applications to have different permissions, you can instead create a custom policy based on medium trust.

Edit the Config File

In order to add permissions, you can edit the exiting web_mediumtrust.config file. To edit the exiting web_mediumtrust.config file, complete the following steps:

1. Locate the medium trust policy file web_mediumtrust.config located by default in the %windir%\Microsoft.NET\Framework\{Version}\CONFIG directory.

2. Open the web_mediumtrust.config file.

3. Add the permissions that you want to grant. For examples, see Adding Permissions (page 7).

Create a Custom Policy Based on Medium Trust

In order to add permissions, you can create a custom policy file based on the medium trust policy. To create a custom policy file, complete the following steps:

Page 13: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

7

1. Locate the medium trust policy file web_mediumtrust.config located by default in the %windir%\Microsoft.NET\Framework\{Version}\CONFIG directory.

2. Copy the web_mediumtrust.config file and create a new policy file in the same directory.

Give the new a name that indicates that it is your variation of medium trust; for example, AllowReflection_Web_MediumTrust.config.

3. Add the permissions that you want to grant. For examples, see Adding Permissions (page 7).

4. Enable the custom policy file on your application by modifying the following lines in your web.config file

under the <system.web> node: <system.web>

<trust level="CustomMedium" originUrl=""/>

<securityPolicy>

<trustLevel name="CustomMedium"

policyFile="AllowReflection_Web_MediumTrust.config"/>

</securityPolicy>

...

</system.web>

Note: Your host may not allow trust level overrides. Please check with your host to see if you have these rights.

Allowing Deserialization

To allow the deserialization of the license added to App_Licenses.dll by the Microsoft IDE, you should add the SerializationFormatter flag to security permission to the Web.config file. Complete the steps in the Modifying or Editing the Config File (page 6) topic to create or modify a policy file before completing the following.

Add the SerializationFormatter flag to the <IPermission class="SecurityPermission"> tag so

that it appears similar to the following: <NamedPermissionSets>

<PermissionSet

class="NamedPermissionSet"

version="1"

Name="ASP.Net">

<IPermission

class="SecurityPermission"

version="1"

Flags="Assertion, Execution, ControlThread,

ControlPrincipal, RemotingConfiguration, SerializationFormatter"/>

...

</PermissionSet>

</NamedPermissionSets>

Adding Permissions

You can add permission, including ReflectionPermission, OleDbPermission, and FileIOPermission, to the web.config file. Note that ComponentOne controls will not work in an environment where reflection is not allowed. Complete the steps in the Modifying or Editing the Config File (page 6) topic to create or modify a policy file before completing the following.

ReflectionPermission

By default ReflectionPermission is not available in a medium trust environment. ComponentOne ASP.NET controls require reflection permission because LicenseManager.Validate() causes a link demand for full trust.

To add reflection permission, complete the following:

1. Open the web_mediumtrust.config file or a file created based on the web_mediumtrust.config file.

Page 14: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

8

2. Add the following <SecurityClass> tag after the <SecurityClasses> tag so that it appears similar

to the following: <SecurityClasses>

<SecurityClass Name="ReflectionPermission"

Description="System.Security.Permissions.ReflectionPermission, mscorlib,

Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

...

</SecurityClasses>

3. Add the following <IPermission> tag after the <NamedPermissionSets> tag so it appears similar

to the following: <NamedPermissionSets>

<PermissionSet class="NamedPermissionSet" version="1"

Name="ASP.Net">

<IPermission

class="ReflectionPermission"

version="1"

Flags="ReflectionEmit,MemberAccess" />

...

</PermissionSet>

</NamedPermissionSets>

4. Save and close the web_mediumtrust.config file.

OleDbPermission

By default OleDbPermission is not available in a medium trust environment. This means you cannot use the ADO.NET managed OLE DB data provider to access databases. If you wish to use the ADO.NET managed OLE DB data provider to access databases, you must modify the web_mediumtrust.config file.

To add OleDbPermission, complete the following steps:

1. Open the web_mediumtrust.config file or a file created based on the web_mediumtrust.config file.

2. Add the following <SecurityClass> tag after the <SecurityClasses> tag so that it appears similar

to the following: <SecurityClasses>

<SecurityClass Name="OleDbPermission"

Description="System.Data.OleDb.OleDbPermission, System.Data,

Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

...

</SecurityClasses>

3. Add the following <IPermission> tag after the <NamedPermissionSets> tag so it appears similar

to the following: <NamedPermissionSets>

<PermissionSet class="NamedPermissionSet" version="1"

Name="ASP.Net">

<IPermission class="OleDbPermission" version="1"

Unrestricted="true"/>

...

</PermissionSet>

</NamedPermissionSets>

4. Save and close the web_mediumtrust.config file.

FileIOPermission

By default, FileIOPermission is not available in a medium trust environment. This means no file access is permitted outside of the application's virtual directory hierarchy. If you wish to allow additional file permissions, you must modify the web_mediumtrust.config file.

Page 15: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

9

To modify FileIOPermission to allow read access to a specific directory outside of the application's virtual directory hierarchy, complete the following steps:

1. Open the web_mediumtrust.config file or a file created based on the web_mediumtrust.config file.

2. Add the following <SecurityClass> tag after the <SecurityClasses> tag so that it appears

similar to the following: <SecurityClasses>

<SecurityClass Name="FileIOPermission"

Description="System.Security.Permissions.FileIOPermission, mscorlib,

Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

...

</SecurityClasses>

3. Add the following <IPermission> tag after the <NamedPermissionSets> tag so it appears similar

to the following: <NamedPermissionSets>

<PermissionSet class="NamedPermissionSet" version="1"

Name="ASP.Net">

...

<IPermission class="FileIOPermission" version="1"

Read="C:\SomeDir;$AppDir$" Write="$AppDir$" Append="$AppDir$"

PathDiscovery="$AppDir$" />

...

</PermissionSet>

</NamedPermissionSets>

4. Save and close the web_mediumtrust.config file.

End-User License Agreement All of the ComponentOne licensing information, including the ComponentOne end-user license agreements, frequently asked licensing questions, and the ComponentOne licensing model, is available online at http://www.componentone.com/SuperPages/Licensing/.

Licensing FAQs This section describes the main technical aspects of licensing. It may help the user to understand and resolve licensing problems he may experience when using ComponentOne .NET and ASP.NET products.

What is Licensing?

Licensing is a mechanism used to protect intellectual property by ensuring that users are authorized to use software products.

Licensing is not only used to prevent illegal distribution of software products. Many software vendors, including ComponentOne, use licensing to allow potential users to test products before they decide to purchase them.

Without licensing, this type of distribution would not be practical for the vendor or convenient for the user. Vendors would either have to distribute evaluation software with limited functionality, or shift the burden of managing software licenses to customers, who could easily forget that the software being used is an evaluation version and has not been purchased.

How does Licensing Work?

ComponentOne uses a licensing model based on the standard set by Microsoft, which works with all types of components.

Page 16: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

10

Note: The Compact Framework components use a slightly different mechanism for run-time licensing than the other ComponentOne components due to platform differences.

When a user decides to purchase a product, he receives an installation program and a Serial Number. During the installation process, the user is prompted for the serial number that is saved on the system. (Users can also enter

the serial number by clicking the License button on the About Box of any ComponentOne product, if available, or

by rerunning the installation and entering the serial number in the licensing dialog.)

When a licensed component is added to a form or Web page, Visual Studio obtains version and licensing information from the newly created component. When queried by Visual Studio, the component looks for licensing information stored in the system and generates a run-time license and version information, which Visual Studio saves in the following two files:

An assembly resource file which contains the actual run-time license

A "licenses.licx" file that contains the licensed component strong name and version information

These files are automatically added to the project.

In WinForms and ASP.NET 1.x applications, the run-time license is stored as an embedded resource in the assembly hosting the component or control by Visual Studio. In ASP.NET 2.x applications, the run-time license may also be stored as an embedded resource in the App_Licenses.dll assembly, which is used to store all run-time licenses for all components directly hosted by Webforms in the application. Thus, the App_licenses.dll must always be deployed with the application.

The licenses.licx file is a simple text file that contains strong names and version information for each of the licensed components used in the application. Whenever Visual Studio is called upon to rebuild the application

resources, this file is read and used as a list of components to query for run-time licenses to be embedded in the appropriate assembly resource. Note that editing or adding an appropriate line to this file can force Visual Studio to add run-time licenses of other controls as well.

Note that the licenses.licx file is usually not shown in the Solution Explorer; it appears if you press the Show All

Files button in the Solution Explorer's Toolbox, or from Visual Studio's main menu, select Show All Files on the

Project menu.

Later, when the component is created at run time, it obtains the run-time license from the appropriate assembly resource that was created at design time and can decide whether to simply accept the run-time license, to throw an exception and fail altogether, or to display some information reminding the user that the software has not been licensed.

All ComponentOne products are designed to display licensing information if the product is not licensed. None will throw licensing exceptions and prevent applications from running.

Common Scenarios

The following topics describe some of the licensing scenarios you may encounter.

Creating components at design time

This is the most common scenario and also the simplest: the user adds one or more controls to the form, the licensing information is stored in the licenses.licx file, and the component works.

Note that the mechanism is exactly the same for Windows Forms and Web Forms (ASP.NET) projects.

Creating components at run time

This is also a fairly common scenario. You do not need an instance of the component on the form, but would like to create one or more instances at run time.

In this case, the project will not contain a licenses.licx file (or the file will not contain an appropriate run-time license for the component) and therefore licensing will fail.

Page 17: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

11

To fix this problem, add an instance of the component to a form in the project. This will create the licenses.licx file and things will then work as expected. (The component can be removed from the form after the licenses.licx file has been created).

Adding an instance of the component to a form, then removing that component, is just a simple way of adding a line with the component strong name to the licenses.licx file. If desired, you can do this manually using notepad or Visual Studio itself by opening the file and adding the text. When Visual Studio recreates the application resources,

the component will be queried and its run-time license added to the appropriate assembly resource.

Inheriting from licensed components

If a component that inherits from a licensed component is created, the licensing information to be stored in the form is still needed. This can be done in two ways:

Add a LicenseProvider attribute to the component.

This will mark the derived component class as licensed. When the component is added to a form, Visual Studio will create and manage the licenses.licx file, and the base class will handle the licensing process as usual. No additional work is needed. For example: [LicenseProvider(typeof(LicenseProvider))]

class MyGrid: C1.Win.C1FlexGrid.C1FlexGrid

{

// ...

}

Add an instance of the base component to the form.

This will embed the licensing information into the licenses.licx file as in the previous scenario, and the base component will find it and use it. As before, the extra instance can be deleted after the licenses.licx file has been created.

Please note, that ComponentOne licensing will not accept a run-time license for a derived control if the run-time

license is embedded in the same assembly as the derived class definition, and the assembly is a DLL. This restriction is necessary to prevent a derived control class assembly from being used in other applications without a design- time license. If you create such an assembly, you will need to take one of the actions previously described create a component at run time.

Using licensed components in console applications

When building console applications, there are no forms to add components to, and therefore Visual Studio won't create a licenses.licx file.

In these cases, create a temporary Windows Forms application and add all the desired licensed components to a form. Then close the Windows Forms application and copy the licenses.licx file into the console application

project.

Make sure the licenses.licx file is configured as an embedded resource. To do this, right-click the licenses.licx file in

the Solution Explorer window and select Properties. In the Properties window, set the Build Action property to

Embedded Resource.

Using licensed components in Visual C++ applications

There is an issue in VC++ 2003 where the licenses.licx is ignored during the build process; therefore, the licensing information is not included in VC++ applications.

To fix this problem, extra steps must be taken to compile the licensing resources and link them to the project. Note the following:

1. Build the C++ project as usual. This should create an E file and also a licenses.licx file with licensing information in it.

2. Copy the licenses.licx file from the app directory to the target folder (Debug or Release).

Page 18: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

12

3. Copy the C1Lc.exe utility and the licensed DLLs to the target folder. (Don't use the standard lc.exe, it has bugs.)

4. Use C1Lc.exe to compile the licenses.licx file. The command line should look like this: c1lc /target:MyApp.exe /complist:licenses.licx /i:C1.Win.C1FlexGrid.dll

5. Link the licenses into the project. To do this, go back to Visual Studio, right-click the project, select

Properties, and go to the Linker/Command Line option. Enter the following: /ASSEMBLYRESOURCE:Debug\MyApp.exe.licenses

6. Rebuild the executable to include the licensing information in the application.

Using licensed components with automated testing products

Automated testing products that load assemblies dynamically may cause them to display license dialog boxes. This is the expected behavior since the test application typically does not contain the necessary licensing information,

and there is no easy way to add it.

This can be avoided by adding the string "C1CheckForDesignLicenseAtRuntime" to the AssemblyConfiguration attribute of the assembly that contains or derives from ComponentOne controls. This attribute value directs the ComponentOne controls to use design-time licenses at run time.

For example: #if AUTOMATED_TESTING

[AssemblyConfiguration("C1CheckForDesignLicenseAtRuntime")]

#endif

public class MyDerivedControl : C1LicensedControl

{

// ...

}

Note that the AssemblyConfiguration string may contain additional text before or after the given string, so the AssemblyConfiguration attribute can be used for other purposes as well. For example:

[AssemblyConfiguration("C1CheckForDesignLicenseAtRuntime,BetaVersion")]

THIS METHOD SHOULD ONLY BE USED UNDER THE SCENARIO DESCRIBED. It requires a design-time license to be installed on the testing machine. Distributing or installing the license on other computers is a violation of the EULA.

Troubleshooting

We try very hard to make the licensing mechanism as unobtrusive as possible, but problems may occur for a number of reasons.

Below is a description of the most common problems and their solutions.

I have a licensed version of a ComponentOne product but I still get the splash screen when I run my project.

If this happens, there may be a problem with the licenses.licx file in the project. It either doesn't exist, contains wrong information, or is not configured correctly.

First, try a full rebuild (Rebuild All from the Visual Studio Build menu). This will usually rebuild the correct

licensing resources.

If that fails follow these steps:

1. Open the project and go to the Solution Explorer window.

2. Click the Show All Files button on the top of the window.

3. Find the licenses.licx file and open it. If prompted, continue to open the file.

Page 19: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

13

4. Change the version number of each component to the appropriate value. If the component does not appear in the file, obtain the appropriate data from another licenses.licx file or follow the alternate procedure following.

5. Save the file, then close the licenses.licx tab.

6. Rebuild the project using the Rebuild All option (not just Rebuild).

Alternatively, follow these steps:

1. Open the project and go to the Solution Explorer window.

2. Click the Show All Files button on the top of the window.

3. Find the licenses.licx file and delete it.

4. Close the project and reopen it.

5. Open the main form and add an instance of each licensed control.

6. Check the Solution Explorer window, there should be a licenses.licx file there.

7. Rebuild the project using the Rebuild All option (not just Rebuild).

For ASP.NET 2.x applications, follow these steps:

1. Open the project and go to the Solution Explorer window.

2. Find the licenses.licx file and right-click it.

3. Select the Rebuild Licenses option (this will rebuild the App_Licenses.licx file).

4. Rebuild the project using the Rebuild All option (not just Rebuild).

I have a licensed version of a ComponentOne product on my Web server but the components still behave as unlicensed.

There is no need to install any licenses on machines used as servers and not used for development.

The components must be licensed on the development machine, therefore the licensing information will be saved into the executable (.exe or .dll) when the project is built. After that, the application can be deployed on any machine, including Web servers.

For ASP.NET 2.x applications, be sure that the App_Licenses.dll assembly created during development of the

application is deployed to the bin application bin directory on the Web server.

If your ASP.NET application uses WinForms user controls with constituent licensed controls, the run-time license is embedded in the WinForms user control assembly. In this case, you must be sure to rebuild and update the user control whenever the licensed embedded controls are updated.

I downloaded a new build of a component that I have purchased, and now I'm getting the splash screen when I build my projects.

Make sure that the serial number is still valid. If you licensed the component over a year ago, your subscription may have expired. In this case, you have two options:

Option 1 – Renew your subscription to get a new serial number.

If you choose this option, you will receive a new serial number that you can use to license the new components

(from the installation utility or directly from the About Box).

The new subscription will entitle you to a full year of upgrades and to download the latest maintenance builds directly from http://prerelease.componentone.com/.

Option 2 – Continue to use the components you have.

Page 20: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

14

Subscriptions expire, products do not. You can continue to use the components you received or downloaded while your subscription was valid.

Technical Support ComponentOne offers various support options. For a complete list and a description of each, visit the ComponentOne

Web site at http://www.componentone.com/SuperProducts/SupportServices/.

Some methods for obtaining technical support include:

Online Resources ComponentOne provides customers with a comprehensive set of technical resources in the form of FAQs, samples and videos, Version Release History, searchable Knowledge base, searchable Online Help and more. We recommend this as the first place to look for answers to your technical questions.

Online Support via our Incident Submission Form This online support service provides you with direct access to our Technical Support staff via an online incident submission form. When you submit an incident, you'll immediately receive a response via e-mail confirming that you've successfully created an incident. This email will provide you with an Issue Reference ID and will provide you with a set of possible answers to your question from our Knowledgebase. You will receive a response from one of the ComponentOne staff members via e-mail in 2 business days or less.

Product Forums

ComponentOne's product forums are available for users to share information, tips, and techniques regarding ComponentOne products. ComponentOne developers will be available on the forums to share insider tips and technique and answer users' questions. Please note that a ComponentOne User Account is required to participate in the ComponentOne Product Forums.

Installation Issues Registered users can obtain help with problems installing ComponentOne products. Contact technical support by using the online incident submission form or by phone (412.681.4738). Please note that this

does not include issues related to distributing a product to end-users in an application.

Documentation Microsoft integrated ComponentOne documentation can be installed with each of our products, and documentation is also available online. If you have suggestions on how we can improve our documentation, please email the Documentation team. Please note that e-mail sent to the Documentation team is for documentation feedback only. Technical Support and Sales issues should be sent directly to their respective departments.

Note: You must create a ComponentOne Account and register your product with a valid serial number to obtain

support using some of the above methods.

Redistributable Files ComponentOne Scheduler for ASP.NET AJAX is developed and published by ComponentOne LLC. You may use it to develop applications in conjunction with Microsoft Visual Studio or any other programming environment that enables the user to use and integrate the control(s). You may also distribute, free of royalties, the following Redistributable Files with any such application you develop to the extent that they are used separately on a single CPU on the client/workstation side of the network:

C1.Web.UI.2.dll

C1.Web.UI.Controls.2.dll

C1.Web.UI.3.dll

C1.Web.UI.Controls.3.dll

Page 21: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

15

C1.Web.UI.4.dll

C1.Web.UI.Controls.4.dll

Site licenses are available for groups of multiple developers. Please contact [email protected] for details.

About this Documentation Acknowledgements

Microsoft, Windows, Windows Vista, Windows Server, and Visual Studio are either registered trademarks or trademarks of

Microsoft Corporation in the United States and/or other countries.

ComponentOne

If you have any suggestions or ideas for new features or controls, please call us or write:

Corporate Headquarters

ComponentOne LLC

201 South Highland Avenue 3rd Floor Pittsburgh, PA 15206 • USA 412.681.4343 412.681.4384 (Fax)

http://www.componentone.com/

ComponentOne Doc-To-Help

This documentation was produced using ComponentOne Doc-To-Help® Enterprise.

Namespaces Namespaces organize the objects defined in an assembly. Assemblies can contain multiple namespaces, which can in turn contain other namespaces. Namespaces prevent ambiguity and simplify references when using large groups of objects such as class libraries.

The general namespace for ComponentOne Web products is C1.Web.UI.Controls. The following code fragment

shows how to declare a C1Schedule using the fully qualified name for this class:

Visual Basic Dim Schedule As C1.Web.UI.Controls.C1Schedule

C# C1.Web.UI.Controls.C1Schedule Schedule;

Namespaces address a problem sometimes known as namespace pollution, in which the developer of a class library is

hampered by the use of similar names in another library. These conflicts with existing components are sometimes called name collisions.

Fully qualified names are object references that are prefixed with the name of the namespace where the object is defined. You can use objects defined in other projects if you create a reference to the class (by choosing Add Reference from the Project menu) and then use the fully qualified name for the object in your code.

Fully qualified names prevent naming conflicts because the compiler can always determine which object is being used. However, the names themselves can get long and cumbersome. To get around this, you can use the Imports

statement (using in C#) to define an alias – an abbreviated name you can use in place of a fully qualified name. For example, the following code snippet creates aliases for two fully qualified names, and uses these aliases to define two objects:

Visual Basic

Page 22: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

16

Imports C1Schedule = C1.Web.UI.Controls.C1Schedule

Imports MySchedule = MyProject.Objects.C1Schedule

Dim shedule1 As C1Schedule

Dim schedule2 As MySchedule

C# using C1Schedule = C1.Web.UI.Controls.C1Schedule;

using MySchedule = MyProject.Objects.C1Schedule;

C1Schedule schedule1;

MySchedule schedule2;

If you use the Imports statement without an alias, you can use all the names in that namespace without qualification provided they are unique to the project.

Creating an AJAX-Enabled ASP.NET Project ComponentOne Scheduler for ASP.NET AJAX requires you to create an ASP.NET AJAX-Enabled project so

that Microsoft ASP.NET AJAX Extensions and a ScriptManager control are included in your project before the C1Schedule control is placed on the page. This allows you to take advantage of ASP.NET AJAX and certain features such as partial-page rendering and client-script functionality of the Microsoft AJAX Library.

When creating AJAX-Enabled ASP.NET projects, Visual Studios 2008 and 2005 both give you the option of creating a Web site project or a Web application project. MSDN provides detailed information on why you would choose one option over the other.

If you are using Visual Studio 2008 with .NET Framework 2.0 or .NET Framework 3.0 or if you are using Visual Studio 2005, you must install the ASP.NET AJAX Extensions 1.0, which can be found at http://ajax.asp.net/. Additionally for Visual Studio 2005 users, creating a Web application project requires installation of a Visual

Studio 2005 update and add-in, which can be found at http://msdn.microsoft.com/; however, if you have Visual Studio 2005 SP1, Web application project support is included and a separate download is not required.

If you are using Visual Studio 2008 and .NET Framework 3.5, you can easily create an AJAX-enabled ASP.NET project without installing separate add-ins because the framework has a built-in AJAX library and controls.

Note: If you are using Visual Studio 2010, see http://www.asp.net/ajax/ for more information on creating an AJAX-

Enabled ASP.NET Project.

The following table summarizes the installations needed:

Visual Studio Version Additional Installation Requirements

Visual Studio 2008, .NET Framework 3.5 None

Visual Studio 2008 and .NET Framework 2.0 or 3.0

Visual Studio 2005 Service Pack 1

ASP.NET AJAX Extensions 1.0

http://www.asp.net/ajax/downloads/archive/

Visual Studio 2005 ASP.NET AJAX Extensions 1.0

Visual Studio update and add-in (2 installs for Web

application project support)

The following topics explain how to create both types of projects in Visual Studio 2008 and 2005.

Page 23: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

17

Creating an AJAX-Enabled Web Site Project in Visual Studio 2008

To create a Web site project in Visual Studio 2008, complete the following steps:

a. From the File menu, select New | Web Site. The New Web Site dialog box opens.

b. Select .NET Framework 3.5 or the desired framework in the upper right corner. Note that if you choose .NET Framework 2.0 or 3.0, you must install the extensions first.

c. In the list of templates, select AJAX 1.0-Enabled ASP.NET 2.0 Web Site.

d. Click Browse to specify a location and then click OK.

Note: The Web server must have IIS version 6 or later and the .NET Framework installed on it. If you

have IIS on your computer, you can specify http://localhost for the server.

A new AJAX-Enabled Web Site is created at the root of the Web server you specified. In addition, a

new Web Forms page called Default.aspx is displayed and a ScriptManager control is placed on the

form. The ScriptManger is needed to enable certain features of ASP.NET AJAX such as partial-page

rendering, client-script functionality of the Microsoft AJAX Library, and Web-service calls.

Creating an AJAX-Enabled Web Application Project in Visual Studio 2008

To create a new Web application project in Visual Studio 2008, complete the following steps.

a. From the File menu, select New | Project. The New Project dialog box opens.

b. Select .NET Framework 3.5 or the desired framework in the upper right corner. Note that if you choose .NET Framework 2.0 or 3.0, you must install the extensions first.

c. Under Project Types, choose either Visual Basic or Visual C# and then select Web. Note that one of

these options may be located under Other Languages.

d. Select AJAX 1.0-Enabled ASP.NET 2.0 Web Application from the list of Templates in the right

pane.

e. Enter a URL for your application in the Location field and click OK.

Note: The Web server must have IIS version 6 or later and the .NET Framework installed on it. If you

have IIS on your computer, you can specify http://localhost for the server.

A new Web Forms project is created at the root of the Web server you specified. In addition, a new

Web Forms page called Default.aspx is displayed and a ScriptManager control is placed on the form.

The ScriptManger is needed to enable certain features of ASP.NET AJAX such as partial-page rendering, client-script functionality of the Microsoft AJAX Library, and Web-service calls.

Creating an AJAX-Enabled Web Site Project in Visual Studio 2005

To create a Web site project in Visual Studio 2005, complete the following steps:

a. From the File menu in Microsoft Visual Studio .NET, select New Web Site. The New Web Site dialog box opens.

b. Select ASP.NET AJAX-Enabled Web Site from the list of Templates.

c. Enter a URL for your site in the Location field and click OK.

Page 24: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

18

Note: The Web server must have IIS version 6 or later and the .NET Framework installed on it. If you have IIS on your computer, you can specify http://localhost for the server.

A new Web Forms project is created at the root of the Web server you specified. In addition, a new

Web Forms page called Default.aspx is displayed and a ScriptManager control is placed on the form.

The ScriptManger is needed to enable certain features of ASP.NET AJAX such as partial-page rendering, client-script functionality of the Microsoft AJAX Library, and Web-service calls.

Creating an AJAX-Enabled Web Application Project in Visual Studio 2005

To create a new Web application project in Visual Studio 2005, complete the following steps.

a. From the File menu in Microsoft Visual Studio 2005, select New Project. The New Project dialog

box opens.

b. Under Project Types, choose either Visual Basic Projects or Visual C# Projects. Note that one of

these options may be located under Other Languages.

c. Select ASP.NET AJAX-Enabled Web Application from the list of Templates in the right pane.

d. Enter a URL for your application in the Location field and click OK.

Note: The Web server must have IIS version 6 or later and the .NET Framework installed on it. If you

have IIS on your computer, you can specify http://localhost for the server.

A new Web Forms project is created at the root of the Web server you specified. In addition, a new

Web Forms page called Default.aspx is displayed and a ScriptManager control is placed on the form.

The ScriptManger is needed to enable certain features of ASP.NET AJAX such as partial-page rendering, client-script functionality of the Microsoft AJAX Library, and Web-service calls.

Adding the C1Schedule Component to a Project When you install ComponentOne Studio for ASP.NET AJAX, the Create a ComponentOne Visual Studio

Toolbox Tab check box is checked, by default, in the installation wizard. When you open Visual Studio, you will

notice a ComponentOne Studio for ASP.NET AJAX tab containing the ComponentOne controls has automatically been added to the Toolbox.

If you decide to uncheck the Create a ComponentOne Visual Studio Toolbox Tab check box during installation,

you can manually add ComponentOne controls to the Toolbox at a later time.

ComponentOne Scheduler for ASP.NET AJAX provides the C1Schedule control. To use C1Schedule, add it to the form or add a reference to the C1.Web.UI.Controls.C1Schedule assembly in your project.

Manually Adding C1Schedule to the Toolbox

To add the C1Schedule control to the Visual Studio Toolbox:

1. Open the Visual Studio IDE (Microsoft Development Environment). Make sure the Toolbox is visible

(select Toolbox in the View menu, if necessary) and right-click the Toolbox to open the context menu.

2. To make the C1Schedule component appear on its own tab in the Toolbox, select Add Tab from the

context menu and type in the tab name, C1Schedule, for example.

3. Right-click the tab where the components are to appear, and select Choose Items from the context menu.

The Choose Toolbox Items dialog box opens.

4. In the Choose Toolbox Items dialog box, go to the .NET Framework Components tab. Sort the list by Namespace (click the Namespace column header) and check the check box for the component belonging to namespace C1.Web.UI.Controls.C1Schedule. Note that there may be more than one component for each namespace.

Page 25: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

19

Adding C1Schedule to the Form

To add C1Schedule to a form:

1. Add the C1Schedule control to the Visual Studio Toolbox.

2. Double-click the control or drag it onto your form.

Adding a Reference to the Assembly

To add a reference to the C1Schedule assembly:

1. Select the Add Reference option from the Project menu of your Web application project. This option is

on the Website menu for Web site projects.

2. Select the ComponentOne C1Schedule assembly from the list on the .NET tab or browse to find the

C1.Web.UI.Controls.2.dll file and click OK.

3. Double-click the form caption area to open the code window. At the top of the file, add the following

Imports statements (using in C#): Imports C1.Web.UI.Controls.C1Schedule

Note: This makes the objects defined in the C1Schedule assembly visible to the project. See Namespaces

(page 15) for more information.

Page 26: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar
Page 27: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

21

Scheduler for ASP.NET AJAX Key

Features Some of the main features of C1Schedule that you may find useful include the following:

Create Outlook-style Appointments

Users can easily add new and edit existing appointments within a C1Schedule. Just as in Microsoft Outlook, you can schedule appointments to occur one-time, all day, or recur over a set amount of time, and reminders can be set so no appointment is missed. Additionally, C1Schedule provides twelve built-in labels and four availability options to help users manage each appointment. Appointments can be organized within categories, and resources and contacts for each appointment can be specified.

For additional information, see Appointments (page 39).

Office 2007 and Vista-style Themes

C1Schedule includes the following five built-in themes, as well as the capability to create customized themes.

Theme Description

ArcticFox (default) The default ArcticFox theme.

Office2007Black Mimes the Office 2007 black theme.

Office2007Blue Mimes the Office 2007 blue theme.

Office2007Silver Mimes the Office 2007 silver theme.

Vista Mimes the Vista theme.

For more information on the built-in visual style themes, see Visual Styles (page 65).

Built-in Data Views

The C1Schedule control includes five built-in data views, allowing you to offer a variety of ways for users to view their schedules. Having built-in data views simplifies development time by allowing you to set the view using one property, ViewType, rather than having to use multiple controls to show each different view. The data views include the following:

Day View: the most detailed view showing appointments for a particular day.

Work Week View: shows appointments for specified work days in a weekly period.

Week View Vertical: shows appointments for any given weekly period in a vertical format.

Week View Horizontal: shows appointments for any given weekly period in a horizontal format.

Month View: shows appointments for one or more months.

For examples of each of the data views and information on how to change a view, see Data Views (page 60).

Built-in Data Layer

Page 28: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

22

C1Schedule gives you the option of using standard ADO.NET databinding to bind C1Schedule to a

database or using an automatically generated XML file to save and load data. The built-in C1Schedule data storage is used in both cases.

Using the DataSource Editor, which corresponds with the DataStorage, you can bind to a database and map to each column in one of its tables to load appointments, categories, contacts, labels, resources, and the status of appointments.

If you prefer to use a built-in datasource, data can be saved to and loaded from an XML file that is specified in the DataFilePath property. This file, C1ScheduleData.xml, is created automatically when a C1Schedule control is added to a form, and it serves as the C1Schedule data storage.

For additional information on binding C1Schedule to a data source or using a built-in data source, see Data and Databinding (page 34).

C1Calendar Compatibility

Link Scheduler for ASP.NET AJAX with Calendar for ASP.NET AJAX by setting just one property. For an example, see Using C1Schedule with C1Calendar (page 80).

Import and Export Multiple Formats

Import and export data from and to iCalendar, XML, and PDF/Image formats. For an example, see Importing and Exporting Schedule Data (page 78).

Rich Client-Side Object Model

C1Schedule uses client-side rendering technology to increase performance in your Web forms. Using client-side code such as JavaScript, you can create browser-interaction tasks that require an immediate response, such as changing the data view of a schedule, allowing users to enable or disable AJAX, showing reminders, and more.

For more information on client-side support provided by C1Schedule, see Client-Side Functionality in Scheduler for ASP.NET AJAX (page 68).

AJAX Support

C1Schedule supports Asynchronous JavaScript and XML (AJAX). AJAX is an approach to creating rich, responsive Web applications like you see in desktop applications. In a desktop application, the user gets immediate responses to their requests. In a traditional Web application, the user's input value is sent to the server, or in other words, a postback is performed, and the server then acts upon the data and responds by sending back a new Web page with the new item. The performance of this Web application is not responsive; the user must wait for the server to respond. But now, with AJAX, the user does not have to wait.

The key advantage of AJAX is that it does not require a postback when communicating with the server. Instead of loading a Web page in the server, the browser loads an AJAX engine. The user's request is sent to the server, the work being done in the background, and the affected portion of the current Web page is updated instantly without reloading the entire page. This avoids the flicker on the screen you see with

postbacks.

Localized Scheduling

Localize text and dates in your schedule as well as view tasks and calendars in the local or a defined time zone. See Changing the Culture of a Schedule (page 72) for more information.

Page 29: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

23

Scheduler for ASP.NET AJAX Quick

Start This quick start describes how to get started with Scheduler for ASP.NET AJAX. In the quick start you'll create

an ASP.NET AJAX-Enabled Web Site, add a C1Schedule scheduling control to the page, change the appearance of the schedule, and observe the schedule's run-time behavior.

Step 1 of 3: Adding C1Schedule to the Project In this step you'll create a new ASP.NET AJAX-Enabled Web Site and add a Scheduler for ASP.NET AJAX scheduling control to your project.

To begin the quick start, complete the following steps:

1. Create a new AJAX-enabled Web site project (page 16).

2. Add a C1Schedule component (page 18) to your form.

Your schedule will look similar to the following:

That's all you need to do! If you run your application now, you'll have a fully-functional scheduling application where you can create and delete appointments. In the next step of this quick start you'll customize this scheduling application's appearance without code.

Page 30: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

24

Step 2 of 3: Customizing the Schedule In the previous step you created a new ASP.NET AJAX-Enabled Web Site and added the C1Schedule control to create a basic scheduling application. In this step you'll customizing the scheduling application's appearance without any code.

Complete the following steps:

1. Click on the C1Schedule control's smart tag to open the C1Schedule Tasks Menu.

2. In the C1Schedule Tasks menu, select the drop-down arrow next to Visual style and select Vista.

This will set the VisualStyle property and apply the Vista style to the schedule. For more information on available built-in styles, see Visual Styles (page 65).

3. In the Tasks menu, click the drop-down arrow next to View type and select WeekViewWorkWeek.

This will set the ViewType property and the schedule will now display the work week. For more information about available data views, see Data Views (page 60).

4. Click once on the C1Schedule control to select it.

5. Navigate to the Properties window and locate the TitleText text box and replace the current text with

{0:dddd, MMMMM dd} – {1:dddd, MMMMM dd}, one of the standard .NET DateTime format specifiers. This changes the format of the starting and ending dates in the navigation bar to show the day of the week, month, and day.

6. In the Properties window, set the ShowViewSelectionBar property to False. This will hide the Day, Week,

and Month navigation controls at the top of the schedule.

The schedule will now appear similar to the following:

Page 31: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

25

In this step you added the schedule to a page and customized its appearance. In the next step you'll run your scheduling application and add an appointment at run time.

Step 3 of 3: Adding an Appointment at Run Time In this quick start, we will use the built-in datasource, an XML file named C1ScheduleData.xml, by default, to

save an appointment added to the schedule. This file is created automatically when the C1Schedule control is added to the form; nothing additional needs to be done in order to use it.

Complete the following steps to observe C1Schedule's run-time interaction:

1. Click the Start Debugging button to run the project.

2. Choose a day of the work week and double-click the 9AM block in the day's column.

The Appointment dialog box appears:

Page 32: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

26

3. Click the Label drop-down arrow and choose a label, for example Must Attend.

Notice the Availability status is already set to Busy.

4. Add a Subject for the appointment, for example "Meeting".

5. Add Location for the appointment, for example "Conference Room".

6. Change the appointment's End time to 10:00 AM.

7. Click the Categories button.

8. In the Categories dialog box, check the Business and Goals/Objectives check boxes and click OK. The

categories are now listed in the Appointment dialog box.

9. Click Save and Close. The appointment is added to the schedule. Note that you can edit the appointment by double-clicking it on the schedule.

10. Click the bottom edge of the appointment, and drag the appointment's end time to 11:00 AM:

Page 33: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

27

This allows you to change an appointment's duration at run time.

11. Click the appointment and drag it to another day and time:

Note that when you adjust the appointment, text appears in the schedule's footer indicating that the appointment has been updated:

12. Switch to another data view, for example DayView, by clicking the button in the navigation bar:

Page 34: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

28

13. Click the left and right (or Previous and Next) arrow navigation buttons in the navigation bar to move to the previous or next day until you locate your appointment.

Note that when you click a navigation button, text appears in the schedule's footer indicating that the schedule is refreshing:

Also, notice that the advancement is smooth; there is no interruption on the screen. This is because AJAX is being used instead of postbacks, so the entire page is not reloaded. C1Schedule does not require any extra effort from you to use AJAX.

Congratulations – you've completed the C1Schedule quick start! You've added the C1Schedule control to your project, customized the appearance of the control, and observed some of the run-time interactions possible with your scheduling application. For more things you can do with schedule, see the Scheduler for ASP.NET AJAX Task-Based Help (page 71) topic.

Page 35: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

29

Design-Time Support in Scheduler for

ASP.NET AJAX C1Schedule provides visual editing to make it easier to create a scheduling application. The following section

details each type of support available in ComponentOne Scheduler for ASP.NET AJAX.

Invoking the Smart Tag

The C1Schedule Tasks menu represents a short-cut menu that provides access to the most commonly used properties in the control. You can invoke each control's smart tag by clicking on the smart tag ( ) in the upper-

right corner of the control. For more information on how to use the smart tags for each control in Scheduler for

ASP.NET AJAX, see C1Schedule Smart Tag (page 29).

Showing the C1Schedule Control's Properties and Events

You can access the properties and events for the C1Schedule control simply by right-clicking the control and

selecting Properties or by selecting the control from the drop-down list box of the Visual Studio Properties

window. To access events, click the lightning bolt Events icon in the Properties window.

C1Schedule Smart Tag In Visual Studio, the C1Schedule control includes a smart tag. A smart tag ( ) represents a short-cut Tasks menu that provides the most commonly used properties in each control.

To access the C1Schedule Tasks menu, click the smart tag in the upper-right corner of the C1Schedule control.

This will open the C1Schedule Tasks menu.

Page 36: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

30

The C1Schedule Tasks menu operates as follows:

View type

This drop-down list sets the ViewType property and the initial schedule data view. Choose DayView (default),

WeekViewWorkWeek, WeekViewWeekVertical, WeekViewWeekHorizontal, or MonthView. For more information about date views, see the Data Views (page 60) topic.

Selected date

This sets the SelectedDate property and the initial starting date of the C1Schedule control. To change the starting

date, click the Selected date drop-down arrow and choose a new date using the date picker.

Width

The Width option sets the Width property and the initial width of the C1Schedule control. By default this is set to 600 pixels.

Height

The Height option sets the Height property and the initial height of the C1Schedule control. By default this is set to

500 pixels.

Show work time only

When this check box is selected, only the times for a work day or week are shown. By default this is not checked

and the ShowWorkTimeOnly property is set to False.

Show reminder form

When this check box is selected, the Reminder form is shown when a reminder alerts and the

ShowReminderForm property is set to True (default).

Show view selection bar

Page 37: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

31

When this check box is selected, the View Selection Bar is shown at the top of the control and the

ShowViewSelectionBar property is set to True (default).

Show navigation bar

When this check box is selected, the navigation buttons appear at the top of the schedule, allowing users to scroll

through the day, week, or month, depending on the view, and the ShowNavigationBar property is set to True (default).

Show status bar

When this check box is selected, a status bar is shown at the bottom of the schedule and the ShowStatusBar

property is set to True (default).

Get dialogs templates

You can load and customize external dialog box templates by selecting the Get dialogs templates option. Use the DialogsPath property to set the template's path. For example, you can put a modified external dialog box template named "Appointment.ascx" into a "Dialogs" folder ("Dialogs\Appointment.ascx") and run the page with a C1Schedule control.

VisualStylePath

The VisualStylePath property specifies the location of the visual styles used for the control. By default, embedded

visual styles are located in ~/C1WebControls/VisualStyles. If you create a custom style, add it to this location

~/VisualStyles/StyleName/C1Schedule/styles.css, set the VisualStylePath property to ~/VisualStyles, and set

the VisualStyle property to StyleName (assuming that StyleName is the name used to define the style in the

style.css file). Uncheck the UseEmbeddedVisualStyles property.

UseEmbeddedVisualStyles

This check box is checked by default so that the internal visual styles, such as ArcticFox and Vista can be used. If

you want to use your own custom styles, uncheck this check box and specify the location of your visual styles

using the VisualStylePath property.

VisualStyle

The Visual style drop-down box allows you to set the VisualStyle property and change the C1Schedule control's

appearance to one of the predefined themes. By default this is set to the ArcticFox theme. For more information about available visual styles, see Visual Styles (page 65).

About

Clicking on the About item displays the About dialog box, which is helpful in finding the version number of

Scheduler for ASP.NET AJAX and online resources.

C1Schedule Context Menu Right-click anywhere on the C1Schedule control to display the Schedule for ASP.NET AJAX context menu, which appears similar to the following image:

Error! Unknown switch argument.

The context menu commands operate as follows:

Get dialogs templates

You can load and customize external dialog box templates by selecting the Get dialogs templates option. Use the DialogsPath property to set the template's path. For example, you can put a modified external dialog box template named "Appointment.ascx" into a "Dialogs" folder ("Dialogs\Appointment.ascx") and run the page with a C1Schedule control.

Page 38: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

32

C1Schedule Properties Window At design-time in Visual Studio, you can access C1Schedule's properties and events through the Properties

window. To open the Properties window, right-click on the C1Schedule control at design time and select

Properties from the context menu. The Properties window will appear:

The Properties window enables easy access to all of the control's properties and events and allows you to set property values at design-time. The Properties window orders the properties either categorically or alphabetically; in the image above properties are ordered categorically. In order to allow the user access to objects and collections when ordered categorically, the Properties window supports a tree view structure where objects can be collapsed

and expanded to hide and show constituent properties.

To view available events, click the lightning bolt Events button.

Page 39: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

33

Scheduler for ASP.NET AJAX Top

Tips This section details some tips and best practices that may be helpful when using Scheduler for ASP.NET AJAX.

The following tips were compiled from frequently asked user questions posted in the Scheduler for ASP.NET AJAX forum.

Tip 1: Use the ScriptManager Control

ComponentOne Scheduler for ASP.NET AJAX requires that Microsoft ASP.NET AJAX Extensions and a

ScriptManager control are included in your project before the C1Schedule control is placed on the page. This

allows you to take advantage of ASP.NET AJAX and certain features such as partial-page rendering and client-script functionality of the Microsoft AJAX Library.

Tip 2: Limit the Number of C1Schedule Controls Per Page

A best practice is to limit the number of C1Schedule controls included per page. Each control uses client script for initialization and redraw operations and from a performance view reducing the number of controls on the page will reduce number of the rendered DOM nodes and reduce client script load. If a page includes several rich controls,

such as 3 or more C1Schedule controls, then performance may be decreased.

Tip 3: Set Visual Styles to Change the Appearance of the Control

Scheduler for ASP.NET AJAX includes several built-in visual styles, including Vista and Office 2007 styles, to quickly style your application. See Visual Styles for more information. You can also create your own custom visual style based on an existing visual style. See Visual Styles (page 65) for more information.

Tip 4: Customize Dialog Boxes

You can change the appearance of dialog boxes by modifying schedule dialog box templates. To do so you would need to:

1. Assign the needed path to the DialogsPath property. Note that the dialog boxs path must be located within Web Application path due to security restrictions (for example, "~/Schedule/Dialogs").

2. Right-click the C1Schedule control and select Get dialogs templates in the context menu.

3. Open the Appointment.ascx file from newly created folder and add needed modifications.

For example, to modify the toolbar's background color to yellow, you could replace <div class="C1DlgToolbar">

with <div class="C1DlgToolbar" style="background-color:yellow; background-

image: none;">

Tip 5: User Client-Side Script to Save Server Load

Scheduler for ASP.NET AJAX had a robust client-side object model, where a majority of server-side properties can be set on the client-side and client-side events are described in the properties window. When a C1Schedule control is rendered, an instance of the client side control will be created automatically. This means that you can enjoy the convenience of accessing properties and methods of the C1Schedule control without having to postback to the server. See Client-Side Functionality in Scheduler for ASP.NET AJAX (page 68) for more information.

Page 40: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

34

Working with Scheduler for ASP.NET

AJAX ComponentOne Scheduler for ASP.NET AJAX provides full scheduling functionality with the familiar look of

Microsoft Outlook™. When you place a C1Schedule control onto a Web form, it appears as a fully functional Outlook-style schedule that allows users to add, edit, and manage their appointments:

Initially, the VisualStyle (page 65) is set to ArcticFox, the ViewType is set to DayView, and the current day is the first date displayed.

The built-in C1WebScheduleStorage component automatically created by C1Schedule links data to your schedule through separate data storages, one for each of the following: appointments, resources, contacts, categories, labels

and statuses. No code is needed to set up the data storage. The data storage file, by default C1ScheduleData.xml, is an XML file used to save and load data. It is specified in the DataFilePath property.

You may also choose to bind C1Schedule to a data source by mapping the datasource tables to the mapping

properties in C1Schedule, either using the DataSource Editor or Visual Studio's Properties window.

At run time, the Appointment dialog box is used to schedule new appointments, allowing you to set a subject, location, label, start and end times, reminder, availability status, and whether the appointment is an all day event.

You can also specify any resources, categories, and contacts here, as well as determine whether the appointment is private. You can easily customize the appearance of the appointment dialog box, if desired.

The following topics provide more information on working with the C1Schedule control, including binding to a

data source, using the Appointment dialog boxes, changing the data view and more.

Data and Databinding Scheduler for ASP.NET AJAX gives you the option of using standard ADO.NET databinding to bind C1Schedule to a datasource or using an automatically generated XML file to save and load data. The built-in

C1WebScheduleStorage, automatically created by C1Schedule, is used in both cases and works on the data layer behind the scenes.

Page 41: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

35

To bind to a database, you must specify the datasource and map it to the C1WebScheduleStorage. Each database table and its columns can be mapped to separate areas in the C1WebScheduleStorage, and then appointments, categories, contacts, labels, resources, and the status of appointments can be loaded from the database. For

example, if the bound datasource contains a field called EmployeeName, you should set the MappingName property

to the name of this field.

If you prefer to use a built-in datasource, data can be saved to and loaded from an XML file that is specified in the

DataFilePath property. This file, C1ScheduleData.xml, is created automatically when a C1Schedule control is added to a form, and it serves as the C1Schedule data storage.

Data Storages

C1WebScheduleStorage is broken into separate storage areas, including the following:

Storage Area Description

AppointmentStorage Used to store appointments.

CategoryStorage Used to store categories.

ContactStorage Used to store contacts.

LabelStorage Used to store labels.

ResourceStorage Used to store resources.

StatusStorage Used to store statuses.

The C1WebScheduleStorage areas can be accessed programmatically through the DataStorage property.

Data Importing and Exporting

The C1WebScheduleStorage component also handles data importing and exporting to other scheduling applications and formats. Instead of binding a component to data, you can use the Export and Import methods for saving and loading data to or from binary, iCal, and XML formats.

The following topics provide more information on data mappings, binding to a database, and using the built-in data storage.

Data Mappings

You can bind to a datasoure and map it to the C1WebScheduleStorage using the Properties window. Each table

and its columns are mapped to separate storage areas, and then appointments, categories, contacts, labels, resources, and the status of appointments can be loaded from the database.

In the Properties window, you can set DataSource and DataMember properties for all C1Schedule data storages. After setting the data source and data member, set the required and optional fields for the storage mapping.

All objects in the C1Schedule's object model are identified by either Id or Index property. To allow data to be

correctly restored from your data sources, you should specify mapping either for the IdMapping or IndexMapping

properties, which makes sense if you bind to your data storages of Resources, Labels, Contacts or Categories.

C1Schedule saves only Ids or Indexes of these objects in the AppointmentStorage. If there is no mapping for

IdMapping or IndexMapping, C1Schedule will not be able to identify the appointment's properties correctly in storages initialized by your data.

To map a data table to the C1Schedule control, first set either the Id mapping drop-down list to a Globally Unique

Identifier (GUID) field or the Index mapping drop-down list to an Integer field.

WebAppointmentStorage Mappings

The following fields are available for mapping to the WebAppointmentStorage:

Page 42: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

36

Mapping Required/Optional Data Type Corresponding Mapping Property

Id Optional GUID IdMapping

Index Optional Integer IndexMapping

Properties Optional Text AppointmentProperties

Body Required Text BodyMapping

End Required Date/Time EndMapping

Location Required Text LocationMapping

Start Required Date/Time StartMapping

Subject Required Text SubjectMapping

WebCategoryStorage Mappings

The following fields are available for mapping to the WebCategoryStorage:

Mapping Required/Optional Data Type Corresponding Mapping Property

Id Optional GUID IdMapping

Index Optional Integer IndexMapping

MenuCaption Optional Text CaptionMapping

Text Required Text TextMappingMapping

WebContactStorage Mappings

The following fields are available for mapping to the WebContactStorage:

Mapping Required/Optional Data Type Corresponding Mapping Property

Id Optional GUID IdMapping

Index Optional Integer IndexMapping

Color Optional Text ColorMapping

MenuCaption Optional Text CaptionMapping

Text Required Text TextMappingMapping

WebLabelStorage Mappings

The following fields are available for mapping to the WebLabelStorage:

Mapping Required/Optional Data Type Corresponding Mapping Property

Id Optional GUID IdMapping

Index Optional Integer IndexMapping

Color Optional Text ColorMapping

MenuCaption Optional Text CaptionMapping

Page 43: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

37

Text Required Text TextMappingMapping

WebResourceStorage Mappings

The following fields are available for mapping to the WebResourceStorage:

Mapping Required/Optional Data Type Corresponding Mapping Property

Id Optional GUID IdMapping

Index Optional Integer IndexMapping

Color Optional Text ColorMapping

MenuCaption Optional Text CaptionMapping

Text Required Text TextMappingMapping

WebStatusStorage Mappings

The following fields are available for mapping to the WebStatusStorage:

Mapping Required/Optional Data Type Corresponding Mapping Property

Id Optional GUID IdMapping

Index Optional Integer IndexMapping

Color Optional Text ColorMapping

MenuCaption Optional Text CaptionMapping

TextMapping Required Text TextMappingMapping

Binding C1Schedule to a Data Source

You can use standard ADO.NET databinding to bind C1Schedule to an existing database. First you must configure your data source. Then you can map tables in the database to the C1WebScheduleStorage to retrieve information from the desired columns of each table. You can load appointments, categories, contacts, labels, resources, and the status of appointments.

In this example, we will map the Appointments table of the Nwind.mdb database, which is installed by default

with C1Schedule, to the Appointment Storage area of the C1WebScheduleStorage.

Configure the datasource

Complete the following steps to add and configure the datasource:

1. Copy the Nwind.mdb file and paste it into your App_Data folder within your Web site project folder.

2. Add a Microsoft AccessDataSource control to your Web application project.

3. Select Configure Data Source from the AccessDataSource Tasks menu. You can access this by clicking the control's smart tag.

4. Click the Browse button and select App_Data in the left pane of the Select Microsoft Access Database dialog box.

5. Select Nwind.mdb in the right pane, click OK, and then click Next to continue through the wizard.

6. In the Configure the Select Statement window, select Specify columns from a table or view and choose

Appointments from the Name drop-down box.

Page 44: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

38

7. Check the following column boxes: Id, Body, End, Location, Start, Subject, and Properties. These are the fields we will map to in the C1WebScheduleStorage.

8. Click Next.

9. You can test the query and then click Finish.

Once the data source is configured, you can map to each of the columns in a table. You can do this through Visual Studio's Properties window.

Map the data source to the C1Schedule data storage

Complete the following steps to map the data source to the C1Schedule data storage:

1. Add a C1Schedule control to your form.

2. Select C1Schedule and expand the DataStorage node in the Properties window.

3. Since you're binding C1Schedule to the data in the Appointments table, expand the AppointmentStorage

node and set the DataSourceID property to AccessDataSource1.

4. To map to the columns of the Appointments table, expand the Mappings node and enter the following column names in the MappingName properties for each mapping node:

Mapping Node MappingName Property

AppointmentProperties Properties

BodyMapping Body

EndMapping End

IdMapping Id

IndexMapping N/A

LocationMapping Location

StartMapping Start

SubjectMapping Subject

The MappingName property corresponds with the name of the column in the database table.

Using the Built-in Data Storage

If you do not have an existing database or do not want to bind C1Schedule to a database, you can use the built-in data source provided by C1Schedule. An XML file, named C1ScheduleData.xml by default and specified in the DataFilePath property, is created automatically when a C1Schedule control is added to a form. This file serves as the C1Schedule data storage; data is saved to and loaded from this file.

When C1Schedule is not bound to a database, and users add appointments, contacts, or other information to the schedule at run time, the information is loaded from and saved to the C1ScheduleData.xml file by default. You

can also add appointments to the data storage programmatically. For example, the following code, added to the

Page_Load event, adds a new appointment to the C1Schedule data storage:

Visual Basic ' Add a new appointment to the data storage.

Dim app As C1.C1Schedule.Appointment

app = Me.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add()

' Add a subject, location, time frame, and date and start time for the

appointment.

app.Subject = "Meeting"

Page 45: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

39

app.Location = "Large Conference Room"

app.Duration = TimeSpan.FromMinutes(45)

app.Start = New Date(2009, 3, 20, 11, 30, 0)

C# // Add a new appointment to the data storage.

C1.C1Schedule.Appointment app;

app = this.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add();

// Add a subject, location, time frame, and date and start time for the

appointment.

app.Subject = "Meeting";

app.Location = "Large Conference Room";

app.Duration = TimeSpan.FromMinutes(45);

app.Start = new DateTime(2009, 3, 20, 11, 30, 0);

Appointments An appointment represents a period of time and detailed information about events that will take place during that period of time. Appointments can span from a specified duration, such as 30 minutes, to multi-day events.

New appointments can be added or existing appointments can be edited by simply double-clicking the time of the appointment.

The Appointment dialog box is used to schedule new appointments at run time, allowing you to set a subject, location, label, start and end time, reminder, availability status, and whether the appointment is an all day event. You can also specify any resources, categories, and contacts here, as well as determine whether the appointment is private.

Page 46: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

40

The Appointment dialog box can also be used to change any of the current settings of an existing appointment. Double-click an existing appointment at run time to edit it.

You can customize how you want an appointment to appear in the schedule, as well as format the Start and End

dates and times within the Appointment dialog box.

Recurrence

Appointments can be set to recur at specified intervals, either daily, weekly, monthly, or yearly. You can use the

Edit recurrence pattern dialog box to determine how often you want an appointment to occur.

Page 47: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

41

The dialog box is split into three areas.

Appointment Time

Lists the start and end time for the appointment, along with the length of time the appointment will last.

Recurrence Pattern

Here you can specify how often and when you want the appointment to recur.

Pattern Description

Daily The Daily settings allow you to repeat an appointment every specified number of days or only on working days:

For example, setting the appointment to Every 2 day(s) will make the appointment appear

every other day. Setting the appointment to Every weekday will make the appointment

appear only Monday through Friday, by default.

Weekly The Weekly settings allow you to repeat the appointment on every specified week on specified days:

Page 48: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

42

For example, setting the appointment to Recur every 2 week(s) on and selecting Tuesday

and Thursday will repeat the appointment every other week on Tuesdays and Thursdays.

Monthly The Monthly settings allow you to repeat an appointment on every specified date at a

specified interval of months or on a specified day and week of the month at a specified interval of months:

For example, setting the appointment to Day 8 of every 2 month(s) will make the appointment appear on the 8th of every other month. Setting the appointment to The 3

Monday of every 2 month(s) will make the appointment appear on the 3rd Monday of every other month.

Yearly The Yearly setting allows you to repeat an appointment on a specified date or a specified day and week of a specified month:

For example, setting the appointment to Every February 2 will make the appointment appear

on February 2nd every year. This setting is ideal for birthdays and anniversaries.

Setting the appointment to The 1 Friday of February will make the appointment appear on

the 1st Friday in February every year.

Range of Recurrence

Specify the start and end time for the recurrence pattern here. The Start text box represents the date from which the recurrence will start. There are three options to choose from for an end date:

No end date will make the appointment recur indefinitely.

End after 10 occurrences will make the appointment recur a specified number of times. For example, if an

appointment repeated every day, setting End after 25 occurrences would allow the appointment to repeat every day 25 times.

End by will make the appointment recur until the date specified.

Page 49: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

43

Editing a Recurrence Pattern

When you double-click a recurring appointment to edit it, you are asked if you want to open only the current occurrence of the appointment.

If you click OK, the Appointment dialog box appears so you can edit the current occurrence of the appointment.

You can change the all of the appointments in the recurrence range from here if you decide by clicking the Change

series button.

When you double-click a recurring appointment to edit it and click Cancel, the Appointment dialog box opens

and allows you to edit the entire series of recurring appointments.

To change the setting of the recurrence for the whole range, click the Recurrence button.

Removing Recurrence from an Appointment

To remove the recurrence pattern from an appointment, use the following steps.

1. If you are editing the current occurrence of an appointment, click the Change Series button. The edit series

version of the appointment dialog box appears.

2. This step is not necessary if you are already in the edit series version of the appointment dialog box (see

Editing a Recurrence Pattern (page 43)). Simply follow the next two steps.

3. Click the Recurrence button. The Edit recurrence pattern dialog box appears.

4. Click the Remove recurrence button.

5. Save and close the appointment.

Labels

A label is simply a color-coded marker that can be added to appointments so that you and others know what type of appointment it is without even having to view its details.

There are twelve predefined labels available in Scheduler for ASP.NET AJAX. The color of the label is visible in every data view in the C1Schedule control.

Predefined Labels

The predefined labels include the following:

Label Color Index

None

0

Important

1

Business

2

Personal

3

Vacation

4

Deadline

5

Must Attend

6

Travel Required

7

Needs Preparation

8

Page 50: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

44

Birthday

9

Anniversary

10

Phone Call

11

Availability Status

The availability status lets everyone know if you will be available at the time when an appointment is scheduled.

There are four predefined availability statuses available in Scheduler for ASP.NET AJAX: Busy, Free, Out of Office, and Tentative. The status is specified by the following colors:

Status Color Index

Busy 0

Free 1

Out of Office 2

Tentative 3

The color of the availability status is only visible in the day and week views of a schedule. For appointments, the color appears in the area to the left of the appointment. Note that if you select the appointment, it will appear highlighted in the status color.

Adding Statuses from a Database

If you have bound C1Schedule to a database, you can map the database statuses to the StatusStorage area of the C1WebScheduleStorage so the statuses can be loaded into your application.

1. Configure the data source as explained in the Binding C1Schedule to a Data Source (page 37) topic, and use the appropriate table and fields in your database:

In the Configure the Select Statement window, when you select Specify columns from a table or

view, choose the table containing resources from the Name drop-down box.

Check the columns from your database to map to the C1WebScheduleStorage.

Once the data source is configured, you can map to each of the columns in the Status table. You can do this through Visual Studio's Properties window.

2. Map the table from your database to the Contact Storage:

a. Select C1Schedule on your form and expand the DataStorage node in the Properties window.

b. Expand the StatusStorage node and set the DataSourceID property to AccessDataSource1, or your datasource.

c. Expand the Mappings node and enter the column names from your database table in the

MappingName properties for each mapping node. If you do not want to map all columns, you can leave the MappingName property blank. Only the TextMappingMapping field is required to be mapped.

3. Run the project, double-click the time for a new or existing appointment, and click the drop-down arrow

next to Availability in the Appointment dialog box. All of the statuses from the database appear in the list. Users can select a status to assign it to their appointment.

Page 51: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

45

Assigning Predefined Statuses to an Appointment

Availability status can be assigned at run time in the Appointment dialog box through the Availability drop-down

list or by adding code to the form at design time.

To assign a contact at run time:

1. Add a new or open an existing appointment.

2. In the Appointment dialog box, click the drop-down arrow next to Availability and select one of the statuses.

To assign a status programmatically:

The following code, added the Page_Load event, assigns a Tentative status to an appointment at design time:

Visual Basic ' Add a new appointment.

Dim app As C1.C1Schedule.Appointment

app = Me.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add()

' Set some details for the appointment.

app.Subject = "Meeting"

app.Location = "Large Conference Room"

app.Duration = TimeSpan.FromMinutes(45)

app.Start = New Date(2009, 3, 21, 11, 30, 0)

' Assign a predefined availability status to the appointment.

app.BusyStatus =

Me.C1Schedule1.DataStorage.StatusStorage.Statuses(C1.C1Schedule.StatusType

Enum.Tentative)

' OR app.BusyStatus =

Me.C1Schedule1.DataStorage.StatusStorage.Statuses.Item(3)

C# // Add a new appointment.

C1.C1Schedule.Appointment app;

app = this.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add();

// Set some details for the appointment.

app.Subject = "Meeting";

app.Location = "Large Conference Room";

app.Duration = TimeSpan.FromMinutes(45);

app.Start = new DateTime(2009, 3, 21, 11, 30, 0);

// Assign a predefined availability status to the appointment.

app.BusyStatus =

this.C1Schedule1.DataStorage.StatusStorage.Statuses[C1.C1Schedule.StatusTy

peEnum.Tentative];

// OR app.BusyStatus =

this.c1Schedule1.DataStorage.StatusStorage.Statuses[3];

Note that either the StatusTypeEnum enumeration or the Index can be used to set the status availability.

When you run the application, the status is assigned to the appointment.

Reminders

Appointment reminders display a Reminder dialog box at a specified time before the appointment occurs. In the

Reminder dialog box, you have the option of dismissing one or more appointments (if multiple appointments are due), opening the appointment, or resetting the reminder to appear again in a set amount of time.

Page 52: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

46

Reminders can be set when creating an appointment by checking the Reminder check box and setting the amount

of time before the appointment that you would like the reminder to appear in the Reminder drop-down list.

Contacts

A list of contacts usually includes all of the people with whom you frequently communicate. You might assign a contact to an appointment if this is the person you need to communicate with regarding the appointment. Contact information is stored in the ContactCollection class. Existing contacts can be retrieved from a data source, or you

can add contacts to the Master Contacts List at run time. Contacts are optional, and an appointment can have one or more contacts assigned to it.

Adding Contacts from a Database

If you have bound C1Schedule to a database, you can map the database contacts to the ContactStorage area of the C1WebScheduleStorage so the contacts can be loaded into your application.

1. Configure the data source as explained in the Binding C1Schedule to a Data Source (page 37) topic, and

use the appropriate table and fields in your database:

In the Configure the Select Statement window, when you select Specify columns from a table or

view, choose the table containing resources from the Name drop-down box.

Check the columns from your database to map to the C1WebScheduleStorage.

Once the data source is configured, you can map to each of the columns in the Contacts table. You can do

this through Visual Studio's Properties window.

2. Map the table from your database to the Contact Storage:

a. Select C1Schedule on your form and expand the DataStorage node in the Properties window.

Page 53: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

47

b. Expand the ContactStorage node and set the DataSourceID property to AccessDataSource1, or your datasource.

c. Expand the Mappings node and enter the column names from your database table in the

MappingName properties for each mapping node. If you do not want to map all columns, you can leave the MappingName property blank. Only the TextMappingMapping field is required to be mapped.

3. Run the project, double-click the time for a new or existing appointment, and click the Contacts button in

the Appointment dialog box. The Contacts window appears, and all of the contacts from the database

appear in the list of Available Contacts. Users can check any of these contacts to assign them to their appointments.

Adding Contacts to the Master Contacts List

C1Schedule supports contacts created at run time through the Master Contacts List dialog box or by adding code

to the form at design time. Once added to the master list, the contact can be assigned to an appointment.

To add a contact at run time:

1. Add a new or open an existing appointment.

2. Click the Contacts button in the Appointment dialog box. The Contacts dialog box appears.

3. Click the Master List button.

4. In the Master Contacts List dialog box, enter a name in the text box and click Add.

Page 54: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

48

The contact will be added to the list.

5. Click OK to close the Master Contacts List dialog box.

To add a new contact programmatically:

Add the following code to the Page_Load event to include "John Smith" in the Master Contacts List:

Visual Basic ' Create the contact.

Dim contcol As C1.C1Schedule.ContactCollection

contcol = Me.C1Schedule1.DataStorage.ContactStorage.Contacts

Dim contact As New C1.C1Schedule.Contact

contact.Text = "John Smith"

' Insert the contact into the Master Contacts List.

contcol.Insert(0, contact)

C# // Create the contact.

C1.C1Schedule.ContactCollection contcol;

contcol = this.C1Schedule1.DataStorage.ContactStorage.Contacts;

C1.C1Schedule.Contact contact = new C1.C1Schedule.Contact();

contact.Text = "John Smith";

// Insert the contact into the Master Contacts List.

contcol.Insert(0, contact);

When you run the application, the new contact appears in the Contacts dialog box when the Contacts button is

clicked in the Appointment dialog box:

Page 55: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

49

Assigning Contacts to an Appointment

At run time, assigning a contact or contacts to an appointment can be done through the Contacts dialog box. By

default, the Contacts dialog box does not initially contain any items. For information on how to add items, see Adding Contacts to the Master Contacts List (page 47).

To assign a contact to an appointment at run time:

1. Click the Contacts button in the Appointment dialog box.

2. Select the check box next to the desired contact and click OK.

Page 56: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

50

The contact appears next in the Contacts text box. Note that you can add multiple contacts to an appointment.

Categories

A category is a keyword or a phrase used to help you organize your appointments. There are 20 predefined categories available in C1Schedule to assign to appointments. You can also use categories from a database or users can create their own custom categories at run time. Categories, which are stored in the CategoryCollection class,

are optional, and an appointment can have one or more categories assigned to it.

Predefined Categories

The predefined categories include the following:

Category Index

Business 0

Competition 1

Favorites 2

Gifts 3

Goals/Objectives 4

Holiday 5

Holiday Cards 6

Hot Contacts 7

Ideas 8

International 9

Key Customer 10

Miscellaneous 11

Personal 12

Phone Calls 13

Status 14

Strategies 15

Suppliers 16

Time&Expenses 17

VIP 18

Waiting 19

Page 57: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

51

Adding Categories from a Database

If you have bound C1Schedule to a database, you can map the database categories to the CategoryStorage area of the C1WebScheduleStorage so the categories can be loaded in your application.

1. Configure the data source as explained in the Binding C1Schedule to a Data Source (page 37) topic, and use the appropriate table and fields in your database:

In the Configure the Select Statement window, when you select Specify columns from a table or

view, choose the table containing categories from the Name drop-down box.

Check the columns from your database to map to the C1WebScheduleStorage.

Once the data source is configured, you can map to each of the columns in the Categories table. You can

do this through Visual Studio's Properties window.

2. Map the table from your database to the Categories Storage:

a. Select C1Schedule on your form and expand the DataStorage node in the Properties window.

b. Expand the CategoryStorage node and set the DataSourceID property to AccessDataSource1, or your datasource.

c. Expand the Mappings node and enter the column names from your database table in the MappingName properties for each mapping node. If you do not want to map all columns, you can leave the MappingName property blank. Only the TextMappingMapping field is required to be

mapped.

3. Run the project, double-click the time for a new or existing appointment, and click the Categories button

in the Appointment dialog box. The Categories window appears, and all of the categories from the

database appear in the list of Available Categories. Users can check any of these categories to assign them

to their appointments.

Adding Categories to the Master Categories List

Scheduler for ASP.NET AJAX supports categories created at run time through the Master Categories List dialog box or by adding code to the form at design time. Once added to the master list, the category can be assigned to an appointment.

To add a category at run time:

1. Add a new or open an existing appointment.

2. Click the Categories button in the Appointment dialog box. The Categories dialog box appears.

3. Click the Master List button:

Page 58: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

52

4. In the Master Categories List dialog box, enter a name in the text box and click Add:

The new category is added at the end of the list.

5. Click OK to close the Master Categories List dialog box.

To add a new category programmatically:

The following code, added to the Page_Load event, creates a new Vacations category.

Visual Basic ' Create a new Vacations category.

Dim newCat As C1.C1Schedule.CategoryCollection

Page 59: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

53

newCat = Me.C1Schedule1.DataStorage.CategoryStorage.Categories

Dim category As New C1.C1Schedule.Category

category.Text = "Vacations"

'Insert the new Vacations category at the top of the Master Categories

List.

newCat.Insert(0, category)

C# // Create a new Vacations category.

C1.C1Schedule.CategoryCollection newCat;

newCat = this.C1Schedule1.DataStorage.CategoryStorage.Categories;

C1.C1Schedule.Category category = new C1.C1Schedule.Category();

category.Text = "Vacations";

// Insert the new Vacations category at the top of the Main List of

Categories.

newCat.Insert(0, category);

When you run the application, the new category appears in the Categories dialog box when the Categories button

is clicked in the Appointment dialog box:

Assigning Categories to an Appointment

At run time, assigning a category or multiple categories to an appointment can be done through the Categories dialog box. By default, there is a list of twenty predefined categories. For more information on how to add

categories to the Categories dialog box, see Adding Categories to the Master Categories List (page 51).

To assign a category to an appointment at run time:

1. Click the Categories button in the Appointment dialog box.

2. Select the check box next to the desired category and click OK:

Page 60: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

54

The category appears next to the Categories text box. Note that you can assign multiple categories to an

appointment.

To assign a category to an appointment programmatically:

Suppose you have already created an appointment and added a category using the following code in the

Page_Load event, for example:

Visual Basic ' Add a new appointment.

Dim app As C1.C1Schedule.Appointment

app = Me.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add()

' Set some details for the appointment.

app.Subject = "Meeting"

app.Location = "Large Conference Room"

app.Duration = TimeSpan.FromMinutes(45)

app.Start = New Date(2009, 2, 26, 11, 30, 0)

' Create a new Vacations category.

Dim newCat As C1.C1Schedule.CategoryCollection

newCat = Me.C1Schedule1.DataStorage.CategoryStorage.Categories

Dim category As New C1.C1Schedule.Category

category.Text = "Vacations"

'Insert the new Vacations category at the top of the Master Categories

List.

newCat.Insert(0, category)

C# // Add a new appointment.

C1.C1Schedule.Appointment app;

app = this.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add();

// Set some details for the appointment.

Page 61: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

55

app.Subject = "Meeting";

app.Location = "Large Conference Room";

app.Duration = TimeSpan.FromMinutes(45);

app.Start = new DateTime(2009, 2, 26, 11, 30, 0);

// Create a new Vacations category.

C1.C1Schedule.CategoryCollection newCat;

newCat = this.C1Schedule1.DataStorage.CategoryStorage.Categories;

C1.C1Schedule.Category category = new C1.C1Schedule.Category();

category.Text = "Vacations";

// Insert the new Vacations category at the top of the Main List of

Categories.

newCat.Insert(0, category);

To assign the new category to the appointment you created, use the following code:

Visual Basic ' Assign the category to the appointment.

app.Categories.Add(category)

C# // Assign the category to the appointment.

app.Categories.Add(category);

Resources

A resource is a keyword or a phrase that defines a source of support for a particular task. Resources, which are stored in the ResourceCollection class, are optional and an appointment can have one or more resources assigned to it.

Adding Resources from a Database

If you have bound C1Schedule to a database, you can map the database categories to the ResourceStorage area of

the C1WebScheduleStorage so the categories can be loaded in your application.

1. Configure the data source as explained in the Binding C1Schedule to a Data Source (page 37) topic, and use the appropriate table and fields in your database:

In the Configure the Select Statement window, when you select Specify columns from a table or

view, choose the table containing resources from the Name drop-down box.

Check the columns from your database to map to the C1WebScheduleStorage.

Once the data source is configured, you can map to each of the columns in the Resources table. You can do this through Visual Studio's Properties window.

2. Map the table from your database to the Resource Storage:

a. Select C1Schedule on your form and expand the DataStorage node in the Properties window.

b. Expand the ResourceStorage node and set the DataSourceID property to AccessDataSource1, or your datasource.

c. Expand the Mappings node and enter the column names from your database table in the MappingName properties for each mapping node. If you do not want to map all columns, you can leave the MappingName property blank. Only the TextMappingMapping field is required to be mapped.

3. Run the project, double-click the time for a new or existing appointment, and click the Resources button

in the Appointment dialog box. The Resources window appears, and all of the resources from the

Page 62: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

56

database appear in the list of Available Resources. Users can check any of these categories to assign them to their appointments.

Adding Resources to the Master Resources List

Scheduler for ASP.NET AJAX supports resources created at run time through the Master Resources List dialog box or by adding code to the form at design time. Once added to the master list, the resource can be assigned to an appointment.

To add a resource at run time:

1. Add a new or open an existing appointment.

2. Click the Resources button in the Appointment dialog box. The Resources dialog box appears.

3. Click the Master List button.

4. In the Master Resources List, enter a resource in the text box and click Add.

Page 63: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

57

The new resource is added to the list.

5. Click OK to close the Master Resources List dialog box.

To add a resource programmatically:

The following code, added to the Page_Load event, creates a Digital Projector resource at design time.

Visual Basic ' Create the Digital Projector resource.

Dim rescol As C1.C1Schedule.ResourceCollection

rescol = Me.C1Schedule1.DataStorage.ResourceStorage.Resources

Dim roomres As New C1.C1Schedule.Resource

roomres.Text = "Digital Projector"

' Insert the resource into the Main List of Resources.

rescol.Insert(0, roomres)

C# // Create the Digital Projector resource.

C1.C1Schedule.ResourceCollection rescol;

rescol = this.c1Schedule1.DataStorage.ResourceStorage.Resources;

C1.C1Schedule.Resource roomres = new C1.C1Schedule.Resource();

roomres.Text = "Digital Projector";

// Insert the resource into the Main List of Resources.

rescol.Insert(0, roomres);

When you run the application, the new resource appears in the Resources dialog box when the Resources button

is clicked in the Appointment dialog box:

Page 64: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

58

Assigning Resources to an Appointment

At run time, assigning a resource or multiple resources can be done through the Resources dialog box. By default,

the Resources dialog box does not contain any resources. For information on how to add resources to the

Resources dialog box, see Adding Resources to the Master Resources List (page 56).

To assign a resource to an appointment at run time:

1. Click the Resources button in the Appointment dialog box.

2. Select the check box next to the desired resource and click OK.

Page 65: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

59

The resource appears next to the Resources text box. Note that you can assign multiple resources to an appointment.

To assign a category to an appointment programmatically:

Suppose you have already created an appointment and added a category using the following code in the

Page_Load event, for example:

Visual Basic ' Add an appointment

Dim app As C1.C1Schedule.Appointment

app = Me.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add()

' Set some details for the appointment.

app.Subject = "Meeting"

app.Location = "Large Conference Room"

app.Duration = TimeSpan.FromMinutes(45)

app.Start = New Date(2009, 3, 3, 11, 30, 0)

' Create the Digital Projector resource.

Dim rescol As C1.C1Schedule.ResourceCollection

rescol = Me.C1Schedule1.DataStorage.ResourceStorage.Resources

Dim roomres As New C1.C1Schedule.Resource

roomres.Text = "Digital Projector"

' Insert the resource into the Main List of Resources.

rescol.Insert(0, roomres)

' Assign the resource to the appointment.

app.Resources.Add(roomres)

C# // Add a new appointment.

C1.C1Schedule.Appointment app;

app = this.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add();

// Set some details for the appointment.

app.Subject = "Meeting";

app.Location = "Large Conference Room";

app.Duration = TimeSpan.FromMinutes(45);

app.Start = new DateTime(2009, 3, 3, 11, 30, 0);

// Create the Digital Projector resource.

C1.C1Schedule.ResourceCollection rescol;

rescol = this.C1Schedule1.DataStorage.ResourceStorage.Resources;

C1.C1Schedule.Resource roomres = new C1.C1Schedule.Resource();

roomres.Text = "Digital Projector";

// Insert the resource into the Main List of Resources.

rescol.Insert(0, roomres);

// Assign the resource to the appointment.

app.Resources.Add(roomres);

To assign the new resource to the appointment you created, use the following code:

Page 66: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

60

Visual Basic ' Assign the resource to the appointment.

app.Resources.Add(roomres)

C# // Assign the resource to the appointment.

app.Resources.Add(roomres);

Data Views Scheduler for ASP.NET AJAX's C1Schedule controls includes several built-in data views. These data views provide similar functionality as those in Microsoft Outlook. You can set the initial data view to use, using the ViewType property. For an example of changing the data view, see the Changing the Data View (page 64) topic.

Available data views include DayView (default), WeekViewWorkWeek, WeekViewWeekVertical,

WeekViewWeekHorizontal, and MonthView.

DayView

When the ViewType property is set to DayView, the C1Schedule control displays a single day's schedule showing a 24-hour period starting from 12:00 AM. This is the default data view.

By default, the core hours of a day (that appear unshaded in the schedule) are considered to be between 8:00 AM

and 7:00 PM. This can be customized using the StartDayTime and EndDayTime properties. Note that the date set

in the SelectedDate property will be the day that initial appears in the schedule.

Page 67: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

61

WeekViewWorkWeek

When the ViewType property is set to WeekViewWorkWeek, the C1Schedule control displays the schedule for the five days of a work week. By default, the first day of the week is Monday but this can be changed by setting the

WeekStart property.

By default, the schedule displays times from 12:00 AM to 11:00 PM and the core hours of a day (that appear unshaded in the schedule) are considered to be between 8:00 AM and 7:00 PM. This can be customized using the

StartDayTime and EndDayTime properties.

WeekViewWeekVertical

When the ViewType property is set to WeekViewWeekVertical, the C1Schedule control displays the schedule for

the seven day week, vertically. This view appears similar to the WeekViewWorkWeek (as both are vertical). By

default, the first day of the week is Monday but this can be changed by setting the WeekStart property.

Page 68: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

62

WeekViewWeekHorizontal

When the ViewType property is set to WeekViewWeekHorizontal, the C1Schedule control displays the schedule

for the seven day week, horizontally. Note that in WeekViewWeekHorizontal mode, times are not displayed

outside of appointments. By default, the first day of the week is Monday but this can be changed by setting the WeekStart property.

Page 69: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

63

MonthWeek

When the ViewType property is set to MonthView, the C1Schedule control displays the schedule for the entire

month, as well as a day or more from the previous and following months, just as in a standard printed calendar.

The days in the current month appear in a different shade so they can be easily seen. Note that in MonthView mode, times are not displayed outside of appointments.

Page 70: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

64

Changing the Data View

You can change the data view of a C1Schedule at design time using the C1Schedule Tasks menu, the Properties

window, in Source view, and in Code. The following example sets the ViewType property to MonthView:

In the Tasks Menu

Complete the following steps:

1. Click the C1Schedule smart tag (page 29) to open the C1Schedule Tasks menu.

2. Click the drop-down arrow next to the View type item and select one of the built-in data views, for

example MonthView.

In the Properties Window

Complete the following steps:

1. Click once on the C1Schedule control to select it.

2. Navigate to the Properties window and locate the ViewType property.

3. Click the drop-down arrow next to the ViewType property and select one of the built-in data views, for

example MonthView.

In Source View

Page 71: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

65

Switch to Source view and add ViewType="MonthView" to the <cc1:C1Schedule> tag so that it appears

similar to the following: <cc1:C1Schedule ID="C1Schedule1" runat="server" ViewType="MonthView">

In Code

Add the following code to the Page_Load event to set the schedule's ViewType to MonthView:

Visual Basic C1Schedule1.ViewType = ScheduleViewEnum.MonthViewView

C#

C1Schedule1.ViewType = ScheduleViewEnum.MonthView;Visual Styles C1Schedule includes Visual Styles allowing you to easily change the control's appearance. The control includes several built-in visual styles, including Vista and Office 2007 styles, to quickly style your application. You can

easily change Visual Styles from the C1Schedule Tasks menu, from the Properties window, and in code. For more information on changing Visual Styles see the Changing the Visual Style (page 67) topic.

The following Visual Styles are included in Scheduler for ASP.NET AJAX:

Theme Description

ArcticFox (default) The default ArcticFox theme.

Office2007Black Mimes the Office 2007 black theme.

Office2007Blue Mimes the Office 2007 blue theme.

Office2007Silver Mimes the Office 2007 silver theme.

Vista Mimes the Vista theme.

ArcticFox

The following image displays the Arctic Fox theme. This is the default appearance of C1Schedule:

Office2007Black

The following image displays the black Office 2007 theme:

Page 72: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

66

Office2007Blue

The following image displays the blue Office 2007 theme:

Office2007Silver

The following image displays the silver Office 2007 theme:

Page 73: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

67

Vista

The following image displays the Vista theme:

Changing the Visual Style

You can change the theme of a C1Schedule using the C1Schedule Tasks menu, the Properties window, in Source

view, and in Code. The following example sets the Visual Style property to Vista:

In the Tasks Menu

Complete the following steps:

1. Click the C1Schedule smart tag (page 29) to open the C1Schedule Tasks menu.

2. Click the drop-down arrow next to the Visual style item and select one of the built-in visual styles, for

example Vista.

In the Properties Window

Page 74: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

68

Complete the following steps:

1. Click once on the C1Schedule control to select it.

2. Navigate to the Properties window and locate the VisualStyle property.

3. Click the drop-down arrow next to the VisualStyle property and select one of the built-in visual styles, for

example Vista.

In Source View

Switch to Source view and add VisualStyle="Vista" to the <cc1:C1Schedule> tag so that it appears

similar to the following: <cc1:C1Schedule ID="C1Schedule1" runat="server"

UseEmbeddedVisualStyles="True" VisualStyle="Vista">

Notice that when you set the VisualStyle property, the UseEmbeddedVisualStyles property is set to True.

In Code

Add the following code to the Page_Load event to set the schedule's VisualStyle to Vista:

Visual Basic C1Schedule1.VisualStyle = "Vista"

C#

C1Schedule1.VisualStyle = "Vista";Customizing the Control's Appearance

If you choose to completely customize the appearance of the C1Schedule you may not wish to use any of the available built-in Visual Styles. In that case, to override any visual styles with your own custom appearance, you

will need to set the C1Schedule.UseEmbeddedVisualStyles property to False.

By default C1Schedule.UseEmbeddedVisualStyles property is True and Visual Styles are used. Any

customizations you make while using Visual Styles will simply set specific elements in the control's appearance on top of the current Visual Style. To start customizing the control's appearance from scratch set

C1Schedule.UseEmbeddedVisualStyles to False and set your own styles.

Client-Side Functionality in Scheduler

for ASP.NET AJAX Scheduler for ASP.NET AJAX has a very rich client-side object model as it is similar to the object model in the server-side control.

When a C1Schedule control is rendered, an instance of the client-side schedule will be created automatically. This means that you can enjoy the convenience of accessing any property and method of the C1Schedule control without having to postback to the server.

For example, suppose a C1Schedule control with name C1Schedule1 is hosted on Web page; When the page is rendered, a corresponding client-side schedule object will be created. Use the following syntax to get the client-side

object on a Web page: $get("C1Schedule1").control

OR $find("C1Schedule1")

By using Scheduler for ASP.NET AJAX's client-side code, you can implement many features in your Web page without the need to take up time by sending information to the Web server. Thus, using client-side code can increase the efficiency of your Web site.

For examples of adding client-side functionality, see Client-Side Tasks (page 81).

Page 75: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

69

Client-Side Properties The following conventions are used when accessing the client object properties:

Server properties on the client are implemented as a pair of Get- and Set- methods.

Method names must start with "get_" (Get-method) and "set_" (Set-method) followed with the server property name. The first letter of the server property name must be lowercase.

For example in the code below the C#, Visual Basic, and JavaScript examples are equivalent:

Visual Basic Dim s As String = C1Schedule1.ViewType

C1Schedule1.ViewType = s

C# string s = C1Schedule1.ViewType;

C1Schedule1.ViewType = s;

JavaScript var schedule = $get("C1Schedule1").control;

var s = schedule.getViewType();

schedule.setViewType(s);

Client-Side Events C1Schedule includes a rich client-side object model in which includes several client-side events. You can access these client-side events from the Properties window. To create a new client-side event, select the drop-down arrow

next to a client-side event and select Add new client side handler.

A placeholder for the client-side event will be added in the Source view. The placeholder will appear similar to the following:

<script type="text/javascript" id="ComponentOneClientScript">

function C1Schedule1_OnClientBeforeAppointmentCreate(eventArgs){

//

// Put your code here.

//

};

</script>

Add your script within the placeholder function.

Page 76: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

70

Available Client-Side Events

The following table names and describes the built-in client-side events available for your use:

Client-Side Event Description

OnClientBeforeAppointmentCreate Fires on client side before appointment create.

OnClientBeforeAppointmentDelete Fires on client side before appointment delete.

OnClientBeforeAppointmentUpdate Fires on client side before appointment update.

OnClientBeforeDialogOpen Fires on client side before dialog open.

OnClientBeforeViewChange Fires on client side before view change.

OnClientCellsSelectionChanged Fires on the client side after cells selection changed.

Page 77: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

71

Scheduler for ASP.NET AJAX Samples Please be advised that this ComponentOne software tool is accompanied by various sample projects and/or demos, which may make use of other ComponentOne development tools included with ComponentOne Studio

Enterprise. Samples can be accessed from the ComponentOne Sample Explorer. To view samples, on your

desktop, click the Start button and then click All Programs | ComponentOne | Studio for ASP.NET | Samples

| Palomino Samples.

C# Samples

The following pages within the ControlExplorer sample installed with ComponentOne Studio for ASP.NET

AJAX detail the C1Schedule control's functionality:

Sample Description

Appointments Displays the functionality of the C1Schedule control.

CalendarNavigation Demonstrates how to integrate Scheduler for ASP.NET AJAX with ComponentOne Calendar for ASP.NET AJAX.

VisualStyles Displays a C1Schedule control where the VisualStyle can be changed a run

time.

Scheduler for ASP.NET AJAX Task-

Based Help The task-based help assumes that you are familiar with programming in Visual Studio .NET and have created a .NET project with a C1Schedule control on the form. By following the steps outlined in the help, you will be able

to create projects demonstrating a variety of Scheduler for ASP.NET AJAX features and get a good sense of what C1Schedule can do.

Note that if you're new to ComponentOne Scheduler for ASP.NET AJAX, you may want to look at the Scheduler for ASP.NET AJAX Quick Start (page 23) topic first.

Note: Scheduler for ASP.NET AJAX requires Microsoft ASP.NET AJAX Extensions installed and a ScriptManager

on the page before the C1Schedule control is placed on the page. You must create an ASP.NET AJAX-Enabled

Project so that the ScriptManager and Microsoft AJAX Extensions are included on the page. For more

information, see Creating an AJAX-Enabled ASP.NET Project (page 16). For more information about Microsoft ASP.NET

AJAX Extensions, see http://ajax.asp.net/. For information about the ScriptManager, see MSDN.

Customizing C1Schedule's Appearance Besides changing the data view and theme of a schedule, you may want to change other items, such as the first day that appears in the schedule or the text in the navigation bar and the format of the date. The following topics provide steps on how to perform these tasks.

Changing the Start Date of the Schedule in DayView

By default, the DayView of the schedule starts with the current date. You can change the date using the

SelectedDate property.

1. Right-click the C1Schedule control and then click Show Smart Tag to view the C1Schedule Tasks menu.

Page 78: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

72

2. In the C1Schedule Tasks menu, click the drop-down arrow next to the Selected date item.

3. Select a date from the calendar.

This will set the SelectedDate property and the schedule will now begin on the date specified.

Note: Setting the SelectedDate property has no effect on the MonthView. If you are one of the week

views, the start date of the schedule becomes the Monday of the week of the SelectedDate.

Changing the Culture of a Schedule

Each culture has different conventions and formats for displaying dates, time, numbers, and other information. This topic illustrates four different ways to set the culture of a C1Schedule using the Culture property.

Setting the Culture Using the Designer

To set the culture of a C1Schedule control, complete the following steps:

1. Click once on the C1Schedule control to select it and navigate to the Properties window.

2. Click the drop-down arrow next to Culture and select a culture from the list. For example, select Japanese

(Japan).

Your C1Schedule now shows a Japanese culture format.

Setting the Culture in Source View

To set the culture in Source view, add Culture="Japanese (Japan)" to the <cc1:C1Schedule> tag.

Once you've set this property, your markup will resemble the following:

<cc1:C1Schedule ID="C1Schedule1" runat="server" Culture="Japanese

(Japan)">

</cc1:C1Schedule>

Setting the Culture Programmatically

To set the culture programmatically, use the following instructions:

Page 79: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

73

1. Import the following namespace into your project:

Visual Basic Imports System.Globalization

C# using System.Globalization;

2. Add the following code into the Page_Load event:

Visual Basic C1Schedule1.Culture = new CultureInfo("ja-JP")

C#

C1Schedule1.Culture = new CultureInfo("ja-JP"); What You've Accomplished

Your C1Schedule is now set to a Japanese culture format. In addition, you have learned how to set the Culture property using the Properties window, in Source view, and C# or Visual Basic code.

Hiding the Navigation Bar

By default the C1Schedule control displays a navigation bar at the top of the control. The navigation bar notes the selected date(s) and lets the user navigate to the previous or next date at run time. You can disable the navigation

bar by setting the ShowNavigationBar property to False.

In the Properties Window

To hide the navigation bar at design time, complete the following steps:

1. Click once on the C1Schedule control to select it and navigate to the Properties window.

2. Click the drop-down arrow next to ShowNavigationBar and select False.

Your C1Schedule control will now not show a navigation bar at run time.

In the Tasks Menu

To hide the navigation bar at design time, complete the following steps:

3. Right-click the C1Schedule control and then click Show Smart Tag to view the C1Schedule Tasks menu.

4. In the C1Schedule Tasks menu, clear the Show navigation bar check box.

Your C1Schedule control will now not show a navigation bar at run time.

In Source View

To hide the navigation bar in Source view, add ShowNavigationBar="False" to the <cc1:C1Schedule>

tag. Once you've set this property, your markup will resemble the following:

<cc1:C1Schedule ID="C1Schedule1" runat="server"

ShowNavigationBar="False">

</cc1:C1Schedule>

In Code

To hide the navigation bar programmatically, add the following code into the Page_Load event:

Visual Basic C1Schedule1.ShowNavigationBar = False

C#

C1Schedule1.ShowNavigationBar = false; What You've Accomplished

Page 80: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

74

You have learned how to set the ShowNavigationBar property using the Properties window, Tasks menu, in Source view, and C# or Visual Basic code. The navigation bar is now disabled in your C1Schedule control, and if you run your application the navigation bar will not be visible at run time.

Hiding the Status Bar

By default the C1Schedule control displays a status bar at the bottom of the control. You can disable the status bar

by setting the ShowStatusBar property to False.

In the Properties Window

To hide the status bar at design time, complete the following steps:

1. Click once on the C1Schedule control to select it and navigate to the Properties window.

2. Click the drop-down arrow next to ShowStatusBar and select False.

Your C1Schedule control will now not show a status bar at run time.

In the Tasks Menu

To hide the status bar at design time, complete the following steps:

1. Right-click the C1Schedule control and then click Show Smart Tag to view the C1Schedule Tasks menu.

2. In the C1Schedule Tasks menu, clear the Show status bar check box.

Your C1Schedule control will now not show a status bar at run time.

In Source View

To hide the status bar in Source view, add ShowStatusBar="False" to the <cc1:C1Schedule> tag. Once

you've set this property, your markup will resemble the following:

<cc1:C1Schedule ID="C1Schedule1" runat="server" ShowStatusBar="False">

</cc1:C1Schedule>

Your C1Schedule control will now not show a status bar at run time.

In Code

To hide the status bar programmatically, add the following code into the Page_Load event:

Visual Basic C1Schedule1.ShowStatusBar = False

C#

C1Schedule1.ShowStatusBar = false;Your C1Schedule control will now not show a status bar

at run time.

What You've Accomplished

You have learned how to set the ShowStatusBar property using the Properties window, Tasks menu, in Source view, and C# or Visual Basic code. The status bar is now disabled in your C1Schedule control, and if you run your application the status bar will not be visible at run time.

Hiding the View Selection Bar

By default the C1Schedule control displays a view selection bar at the top of the control. The view selection bar enables the user to switch the ViewType at run time. You can disable the status bar by setting the

ShowViewSelectionBar property to False.

In the Properties Window

To hide the view selection bar at design time, complete the following steps:

Page 81: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

75

1. Click once on the C1Schedule control to select it and navigate to the Properties window.

2. Click the drop-down arrow next to ShowViewSelectionBar and select False.

Your C1Schedule control will now not show the view selection bar at run time.

In the Tasks Menu

To hide the view selection bar at design time, complete the following steps:

1. Right-click the C1Schedule control and then click Show Smart Tag to view the C1Schedule Tasks menu.

2. In the C1Schedule Tasks menu, clear the Show view selection bar check box.

Your C1Schedule control will now not show the view selection bar at run time.

In Source View

To hide the view selection bar in Source view, add ShowViewSelectionBar="False" to the

<cc1:C1Schedule> tag. Once you've set this property, your markup will resemble the following:

<cc1:C1Schedule ID="C1Schedule1" runat="server"

ShowViewSelectionBar="False">

</cc1:C1Schedule>

Your C1Schedule control will now not show the view selection bar at run time.

In Code

To hide the view selection bar programmatically, add the following code into the Page_Load event:

Visual Basic C1Schedule1.ShowViewSelectionBar = False

C#

C1Schedule1.ShowViewSelectionBar = false;Your C1Schedule control will now not show

the view selection bar at run time.

What You've Accomplished

You have learned how to set the ShowViewSelectionBar property using the Properties window, Tasks menu, in Source view, and C# or Visual Basic code. The view selection bar is now disabled in your C1Schedule control, and if you run your application the view selection bar will not be visible at run time.

Working with Appointments at Run Time The following topics provide steps on how to add, delete, print, and modify appointments at run time.

Adding an Appointment

Appointments can be added to the schedule using the Appointment dialog box.

1. Double-click the day or time of the appointment. The Appointment dialog box appears.

2. Specify a Subject, Location and any additional information you would like to assign to the appointment.

3. Click the Save and Close button to add the new appointment to the schedule.

Deleting an Appointment

Selected appointments can be easily removed from your schedule through the Appointment dialog box.

1. Double-click the appointment you would like to remove. The Appointment dialog box appears.

2. Click the Delete button. The appointment is removed from the schedule.

Page 82: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

76

Creating a Recurring Appointment

The Edit recurrence pattern dialog box can be used to create an appointment that recurs over a specified period of

time.

1. Add a new appointment or double-click an existing appointment. The Appointment dialog box appears.

2. Click the Recurrence button. The Edit recurrence pattern dialog box appears.

3. Choose the desired recurrence settings and click OK to close the dialog box. The recurrence pattern will not be saved until the appointment is saved.

4. Click Save and Close in the Appointment dialog box to save the appointment and the recurrence pattern.

Printing an Appointment

Appointments can be printed through the Appointment or Edit Appointment dialog box.

1. Double-click the day or time of the appointment you would like to schedule or double-click an existing

appointment to open one of the Appointment dialog boxes.

2. In the dialog box, click the Print button.

Changing the Time within the Appointment Dialog Box

You can change the time of an appointment from within the Appointment dialog box.

1. Double-click the appointment to open one of the appointment dialog boxes.

2. Highlight the part of the time you want to change. For example, suppose the appointment starts at 11:00

AM and you need to change it to 1:30 PM. Select 11.

Page 83: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

77

3. Enter the desired time or use the up and down arrow keys on your keyboard. If following our example,

you can press the up arrow key until you reach 1. You can then select the second part of the time, 00, and

enter 30 or use the up or down arrow keys to move through the minutes.

4. To change AM to PM, select AM and click the up or down arrow key on your keyboard.

5. Repeat steps 2-4 for the End time.

Note: If you are in DayView or one of the week views, you can simply drag the appointment to the

desired time without having to change the time within the Appointment dialog box.

Adding Keyboard Support The C1Schedule control lets you easily add keyboard accessibility to the control. You can use the AccessKey

property to set how the user navigates to the schedule and through your Web site.

In the following examples you'll set the AccessKey property to s so that pressing the ALT+S key combination at run time brings the C1Schedule control into focus.

In the Designer

Complete the following steps:

1. Click once on the C1Schedule control to select it and navigate to the Properties window.

2. Click in the text box next to the AccessKey property and enter "s".

In Source View

In Source view add AccessKey="s" to the <cc1:C1Schedule> tag so it appears similar to the following: <cc1:C1Schedule ID="C1Schedule1" runat="server" AccessKey="s">

In Code

Add the following code to the Page_Load event to set the AccessKey property to s:

Visual Basic Me.C1Schedule1.AccessKey = "s"

C# this.C1Schedule1.AccessKey = "s";

What You've Accomplished

Run your application. Observe that pressing the ALT+S key combination brings the schedule into focus.

Disabling the Reminder Form By default the C1Schedule control displays a reminder form when an appointment is near completion. At run time,

users can choose not to display a reminder by clearing the Reminder check box in the Appointment dialog box.

You can disable the Reminder dialog box altogether by setting the ShowReminderForm property to False.

In the Properties Window

To hide the Reminder dialog box at design time, complete the following steps:

1. Click once on the C1Schedule control to select it and navigate to the Properties window.

2. Click the drop-down arrow next to ShowReminderForm and select False.

Your C1Schedule control will now not show the Reminder dialog box at run time.

In the Tasks Menu

To hide the Reminder dialog box at design time, complete the following steps:

Page 84: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

78

1. Right-click the C1Schedule control and then click Show Smart Tag to view the C1Schedule Tasks menu.

2. In the C1Schedule Tasks menu, clear the Show reminder form check box.

Your C1Schedule control will now not show the Reminder dialog box at run time.

In Source View

To hide Reminder dialog box in Source view, add ShowReminderForm="False" to the <cc1:C1Schedule>

tag. Once you've set this property, your markup will resemble the following:

<cc1:C1Schedule ID="C1Schedule1" runat="server"

ShowReminderForm="False">

</cc1:C1Schedule>

Your C1Schedule control will now not show the Reminder dialog box at run time.

In Code

To hide the Reminder dialog box programmatically, add the following code into the Page_Load event:

Visual Basic C1Schedule1.ShowReminderForm = False

C#

C1Schedule1.ShowReminderForm = false;Your C1Schedule control will now not show the

Reminder dialog box at run time.

What You've Accomplished

You have learned how to set the ShowReminderForm property using the Properties window, Tasks menu, in

Source view, and C# or Visual Basic code. The Reminder dialog box is now disabled in your C1Schedule control,

and if you run your application the Reminder dialog box will no longer appear at run time.

Importing and Exporting Schedule Data You can import and export C1Schedule data to several common formats including iCal, binary, and XML. This makes it convenient for users to then import exported C1Schedule data into Outlook or another scheduling application. In the following steps, you'll add two buttons to the Page: one to export and one to import data from a defined location.

Complete the following steps:

1. Navigate to the Visual Studio Toolbox and add two Button controls to the form. This control can be

found on the Standard tab. If necessary, right-click the Toolbox and select Show All to view all tabs.

2. In the Properties window, set Button1's Text property to "Import" and Button2's Text property to "Export".

The form will look similar to the following image:

Page 85: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

79

3. Double-click the Import button to switch to Code view and add the Button1_Click event.

4. Add the following code to the Button1_Click event:

Visual Basic Me.C1Schedule1.DataStorage.Import("C:\temp\Schedule.xml",

C1.C1Schedule.FileFormatEnum.XML)

C# this.C1Schedule1.DataStorage.Import(@"C:\temp\Schedule.xml",

C1.C1Schedule.FileFormatEnum.XML);Return to Design view and double-click the Export

button to switch to Code view and add the Button2_Click event.

6. Add the following code to the Button2_Click event:

Visual Basic Me.C1Schedule1.DataStorage.Export("C:\Schedule.xml",

C1.C1Schedule.FileFormatEnum.XML)

C# this.C1Schedule1.DataStorage.Export(@"C:\Schedule.xml",

C1.C1Schedule.FileFormatEnum.XML);

You can now import and export your scheduling data at run time using the Import and Export buttons. What

You've Accomplished

You've learned how to import and export schedule data in code. You can adjust the code above to change the location and format of your data.

Run your application and observe:

1. Add some appointments to your schedule.

2. Click the Export button. The schedule data will be exported to the file location indicated in the code above.

3. Delete the appointments you just created.

4. Click the Import button. The data you exported will be imported from the saved location, and the appointments you created will be restored.

Page 86: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

80

Using C1Schedule with C1Calendar Scheduler for ASP.NET AJAX is compatible with the Calendar for ASP.NET AJAX product. Linking a

C1Schedule control to a C1Calendar control is as simple as setting a single property.

Note: While it is compatible with Calendar for ASP.NET AJAX, Scheduler for ASP.NET AJAX is not compatible with the WebCalendar for ASP.NET product.

In the Tasks Menu

Complete the following steps to link a calendar and schedule:

1. Add a C1Calendar control to your form.

2. Click the C1Calendar smart tag ( )to show the C1Calendar Tasks menu.

3. Click the drop-down arrow next to the Web Schedule item and select C1Schedule1:

In the Properties Window

Complete the following steps to link a calendar and schedule:

1. Add a C1Calendar control to your form.

2. Click once on the C1Calendar control to select it and navigate to the Properties window.

3. In the Properties window, select the drop-down arrow next to the C1Calendar.WebSchedule property

and select C1Schedule1.

In Code

To link the calendar and schedule programmatically, add the following code into the Page_Load event:

Visual Basic C1Calendar1.WebSchedule = "Schedule1"

C# C1Calendar1.WebSchedule = "Schedule1";

What You've Accomplished

Run the project and click one of the dates in the calendar. Notice the date in the schedule changes to match the selected date in the calendar.

For more information on C1Calendar, see the ComponentOne Calendar for ASP.NET AJAX documentation included with the ComponentOne Studios and available on ComponentOne HelpCentral.

Page 87: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

81

Client-Side Tasks The following topics show how to perform various client-side tasks using Scheduler for ASP.NET AJAX. For

more information about Scheduler for ASP.NET AJAX's client-side support, see the Client-Side Functionality in

Scheduler for ASP.NET AJAX (page 68) topic.

Getting and Setting the Display Date in Day View

This topic explains how to set the date that appear in a DayView schedule, as well as how to set an alert showing the date currently appearing in the schedule.

To set the first date to appear in the schedule:

1. Add two Input (Button) controls to your form. This control can be found on the HTML tab of the

toolbox. If necessary, right-click the Toolbox and select Show All to view all tabs.

2. Select the first Input (Button) and set its Value property to Set Date in the Visual Studio Properties

window.

3. Set the Value property of the second Input (Button) to Get Date. Your form will now look like the following image.

4. Double-click the Set Date button. A new JavaScript function base is automatically generated and added to the Web form, which is shown in Source view.

5. Add the following script to the base, as in the following example: function Button1_onclick() {

aJSDate=new Date(2009,3,10);

var schedule = $get("C1Schedule1").control;

schedule.setDisplayDate(aJSDate);

}

This code uses the setDisplayDate client-side method to set the first date in the calendar to February 10,

2007 when the Set Date button is clicked.

6. Run the project. Notice the current date is the date that appears in the calendar.

7. Click the Set Date button. The date changes to March 10, 2009.

8. Go back to the project designer, and now add code for the Get Date button.

Page 88: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

82

To set an alert showing the first date:

1. Double-click the Get Date button. A new JavaScript function base is automatically generated and added to the Web form, which is shown in Source view.

2. Add the following code to the base, as in the following example: function Button2_onclick() {

var schedule = $get("C1Schedule1").control;

alert(schedule.getDisplayDate());

}

This code uses the getDisplayDate client-side method to show an alert box with the date that is currently

shown in the schedule.

3. Run the project. Notice the current date is the date that appears in the schedule.

4. Click the Get Date button. The date in the schedule appears in the alert box.

Adding Previous and Next Navigation

In this topic you'll add Previous and Next buttons to the page that will work similarly to the arrow navigation button at the top of the schedule control. The buttons will navigate the schedule to the previous or next date.

Complete the following steps:

1. Add two Input (Button) controls to your form. This control can be found on the HTML tab of the

Toolbox. If necessary, right-click the Toolbox and select Show All to view all tabs.

2. Select the first Input (Button) and set its Value property to Previous in the Visual Studio Properties window.

3. Set the Value property of the second Input (Button) to Next. Your form will now look like the following image.

4. Double-click the Previous button. A new JavaScript function base is automatically generated and added to the Web form, which is shown in Source view.

5. Add the following script to the base, as in the following example: function Button1_onclick() {

var schedule = $get("C1Schedule1").control;

schedule.navigateDatesLeft();

}

Page 89: ComponentOne Scheduler for ASP.NET AJAX · 1 ComponentOne Scheduler for ASP.NET AJAX Overview ComponentOne Scheduler for ASP.NET provides full scheduling functionality with the familiar

83

This code uses the navigateDatesLeft client-side method to navigate the schedule to the previous date

when the Previous button is clicked.

6. Return to Design view and double-click the Next button. A new JavaScript function base is automatically generated and added to the Web form, which is shown in Source view.

7. Add the following code to the base, as in the following example: function Button2_onclick() {

var schedule = $get("C1Schedule1").control;

schedule.navigateDatesRight();

}

This code uses the navigateDatesRight client-side method to navigate the schedule to the next date when

the Next button is clicked.

8. Run the project. Notice the current date is the date that appears in the schedule.

9. Click the Previous button. The current date changes to the previous date.

10. Click the Next button. The current date changes to the next date.