In the last step you created a simple scheduling application. In this step you'll walk through binding a data source to the scheduling application you created in the Creating the Scheduling Application topic.
To bind the C1Schedule control to a data source, complete the following steps:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.AppointmentsTableAdapter.Fill(Me.AppointmentsDS.Appointments) |
To write code in C#
C# |
Copy Code
|
---|---|
this.appointmentsTableAdapter.Fill(this.appointmentsDS.Appointments); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.AppointmentsTableAdapter.Update(Me.AppointmentsDS.Appointments) |
To write code in C#
C# |
Copy Code
|
---|---|
this.appointmentsTableAdapter.Update(this.appointmentsDS.Appointments); |
Mapping | Property |
---|---|
Id mapping | Id |
Properties | Properties |
Body | Body |
End | End |
Location | Location |
Start | Start |
Subject | Subject |
Notice that the data from the Appointments table is reflected in both the C1Calendar and C1Schedule controls.
By default, the Office 2007 Visual Style gives you added navigation options by enabling the navigation panels and the browse buttons. If an appointment is not present in the visible range of dates, a navigation panel appears on the left and right sides of the schedule. Clicking on one of the panels changes the current view to the previous or next date with appointments. If there is not a previous or next appointment, the corresponding panel is disabled. In the image below the Previous Appointment panel is enabled and the Next Appointment panel is disabled.
You can also use the navigation buttons to navigate through the schedule. The navigation buttons appear on the Title bar of the C1Schedule control. Clicking on one of the navigation buttons changes the current view to the next or previous range of dates.
You have successfully bound the scheduling application to a data source. In the next topic, you will learn how to customize calendar settings for a 10-hour day, four-day work week.