Way to bind data to Schedule Control

I want to know if there is a way to bind data to a schedule control.
Data is coming from a query and will be returned as dataset. I just want to know if there is a way for me to bind the dataset to the schedule control.
Or if not, is there a way to convert the dataset to a class or .schedule file as what I have read on the source code of the samples.

I need help because I have searched many times and I cannot seem to figure out a way to bind my data from SQL to the SF Schedule Control 


1 Reply

SN Sindhu Nagarajan Syncfusion Team May 9, 2018 10:28 AM UTC

Hi John, 

Thanks for your interest in Syncfusion Products. 

We are able to understand your scenario. We have created a sample for adding the SQL data into the Schedule control as per your requirement. In the sample, we have populated the ScheduleControl with the SQL database.  
  
Note: 
To work with the SQL data at your client machine, please modify the connection string by creating a data base using the SQL Express and add the table “ScheduleData” like the attached local DB file. Moreover, to update the changes from the ScheduleControl appointment, you can save the updated changes to SQL by using the ShowingAppointmentForm event. In that event, the e.Item will holds the values of the appointment. Please refer to the below code,  

Code Example 
//Event Subscription 
scheduleControl1.ShowingAppointmentForm += ScheduleControl1_ShowingAppointmentForm; 
 
//Event Customization 
private void ScheduleControl1_ShowingAppointmentForm(object sender, ShowingAppointFormEventArgs e) 
{ 
    System.DateTime selctedDate = scheduleControl1.Calendar.SelectedDates[0]; 
    IScheduleAppointment item = e.Item; 
    item.StartTime = new System.DateTime(selctedDate.Year, selctedDate.Month, selctedDate.Day, e.Item.StartTime.Hour, e.Item.StartTime.Minute, e.Item.StartTime.Second); 
    item.EndTime = new System.DateTime(selctedDate.Year, selctedDate.Month, selctedDate.Day, e.Item.EndTime.Hour, e.Item.EndTime.Minute, e.Item.EndTime.Second); 
    e.AppointmentForm.SetDataProvider(this.scheduleControl1.DataSource, item); 
} 

Sample Link: Schedule Control 
 
Please let us know if you have any other queries. 
 
Regards,  
Sindhu  


Loader.
Up arrow icon