Bind Windows Forms Scheduler to Data at Design Time
KetticScheduler WinForms control is capable of binding the control to data source without using any code. This is achieved through applying the ActionList to specify the scheduling data binding source component. The powerful provider architecture allows the users to easily integrate this component into Windows Forms application. The KetticScheduler control is able to be bound to a data source so that any other data control can access it, to a business object of any arbitrary structure, custom fields to an appointment, as well as appointments to resources.
Tutorial on Binding KetticScheduler to Data at Design Time
- Create a new Windows Forms project or open an existing one, drag and drop a KetticScheduler control and a SchedulerBindingDataSource component on a form
- Open the ActionList in the smart tag of KetticScheduler control, select the instance of the SchedulerBindingDataSource component to specify the data source for KetticScheduler control.
- Open the smart tag of the SchedulerBindingDataSource, there are two data provider properties available, the Appointments and the Resources. To set data source with the two providers, click the EventProvider property in property window and drop down the DataSource sub-property list and choose the Add Project DataSource... to show the Data Source Configuration Wizard dialog.
- Choose the Database type in the Choose a Data Source Type, and then click the Next button to add a connection to the KetticSchedulerData.mdf file included in the KetticWinFormsUI component.
- After add the connection to the KetticSchedulerData.mdf file, go back to the Choose a Data Connection page and click the Next button. When the dialog popup, leave the file located in the \Samples\DataSources directory. And then click the Next to continue in the Save the Connection String in the page.
- Click the Tables checkbox to choose the Appointments, Resources and AppointmentsResources tables in the Choose Your Database Objects. Click Finish button to close the dialog and a DataSet component will be created. Add the DataSet component to the component tray.
- Map the properties of the objects in KetticScheduler and the data source objects. Open the SchedulerBindingDataSource ActionList, specify the DataSource and set DataMember properties for the EventProvider and ResourceProvider respectively.
- Click on the Edit Appointment Mapping link in the SchedulerBindingDataSource ActionList to open the Appointment Mapping Dialog. Map all Appointment properties with DataSource properties
- Click in the Edit Resource Mapping link to edit the ResourceMappingInfo in the SchedulerBindingDataSource ActionList. Choose the ID and ResourceName for the respective properties and close the dialog.
- Copy and paste the C# code below to fill the data tables in the data set.
- After applying the event provider data source if dataset is filled, implement the Rebind method of the SchedulerBindingDataSource object.
- Run the Scheduler Windows Forms application to check the data binding.