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);
} |
Please let us know if you have any other queries.
Regards,
Sindhu