Welcome to LightSwitch Desktop Edition > Scheduler for LightSwitch Overview > Scheduler for LightSwitch Quick Start > Binding C1Scheduler to a Data Source > Adding Other Data Source |
You can easily associate additional, separate data sources, such as a contacts list, with a C1Scheduler control. In this example, we have already associated the Holidays data source with the Calendar screen, and now we are going to add a Contacts data source. To do this, follow these steps:
The mapping between the Contacts table properties and the C1Contacts storage model is handled by the C1ContactPlaceholder element, similar to the way the C1Scheduler storage model is handled by the C1AppointmentPlaceholder element.
If you select the table in the screen designer and view the Visual Studio Properties window, you'll notice the Control Type for the Contacts table is Default (C1ContactPlaceholder).
Just as you must do with the C1AppointmentPlaceholder, the Primary Key property must be set to the name of an integer, string, or GUID property that uniquely identifies a contact record in the data source. The remaining drop-down controls let you specify string property names, as appropriate.
Set the properties as shown in the following image:
Repeat this process for the C1Categories and C1Resources storage models, if desired. Mappings are handled by the C1CategoryPlaceholder and C1ResourcePlaceholder, respectively. The properties are the same as for the ContactsTemplate.