ComponentOne Scheduler for ASP.NET: Working with Scheduler for ASP.NET AJAX > Appointments > Contacts > Adding Contacts to the Master Contacts List

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.

 

 

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:

 


Send comments about this topic to ComponentOne.
Copyright ComponentOne LLC. All rights reserved.