$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Scheduler control for Windows Forms
Create rich Outlook style functionality and add rich scheduling interfaces to C# Windows application
Home > WinForms UI Controls > User Manual > Guide of Binding Scheduler to Data in C#

Tutorial of Scheduler WinForms Control Data Binding in C#.NET

KetticScheduler control allows the developers to create and bind this component to data source in C# code for Windows Forms application. This control provides large flexibility for users to bind Scheduler to data in various situations. In the C# tutorial below, we shall bind the KetticScheduler to a database whose appointments and resources are in a many to many relation. In the data binding process, we shall use the SchedulerBindingDataSource component of the KetticScheduler.

KetticScheduler Data Binding in Windows Forms

To bind the KetticScheduler control to a data source, we must add the control to your Windows Form, and create a SchedulerBindingDataSource instance. The following steps demonstrate how to setup the instance for KetticScheduler data binding.
  1. Drag and drop the SchedulerBindingDataSource component from the Toolbox on your form in Windows application.
  2. Open the Properties Window of this component, click the EventProvider property and expand the drop down list of the DataSource, click the Add Project DataSource... to show the Data Source Configuration Wizard dialog.
  3. Select the Access Database File connection and choose the sample database under the path, \Sample\DataSources directory, to create a DataSet component and add sample database to the component tray.
  4. Choose the Edit in Dataset Designer in the SchedulerDataSet smart tag, and connect the Appointments and AppointmentsResources tables, then name it to be Appointments_AppointmentsResources. Customize the Key Columns entry to be ID from the Appointments table and change the Foreign Key Columns from the AppointmentsResources table to AppointmentID
  5. Design the Windows Forms project and a few helpful adapter components will be created to fill the dataset in Scheduler.

Map Properties in Scheduler at Design Time

KetticScheduler control provides two mapping information instances, AppointmentMappingInfo and ResourceMappingInfo, for the developers to map the fields of the data source to the correct properties of the scheduler. The two mapping instances can be edited in the Edit Appointment Mapping button and the Edit Resource Mapping button.

C# code for Mapping Fields of Data Source for Scheduler

Alternatively, the developers can also map the fields of the data source via C# code to the correct scheduler properties. The C# code below shows how to assign the two information instances, AppointmentMappingInfo and ResourceMappingInfo, to SchedulerBindingDataSource.

Retrieve Data for Scheduler in C#.NET

  • To retrieve the data in KetticScheduler, we should fill the data set in the same order as we set the DataSource property of KetticScheduler control. Moreover, we can call the DataBind method when we fill the data set.
  • After filling the data set, we can assign the Appointments and Resources tables from the data set to our SchedulerBindingDataSource.
  • At last, assign the SchedulerBindingDataSource instance to KetticScheduler as the DataSource.

Update Data Source for KetticScheduler in C#.NET

When we need to update the data source of the KetticScheduler control, we can use the C# code below and add it to the Click event handler of the Update button. After that, when the data in the source is updated, the KetticScheduler control will update the data at the same time.
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls