Hi Emir,
Thank you for contacting Syncfusion support.
Query 1: Regarding changing TimeFormat
SfScheduler supports to change time format from 12 hour to 24 hour by using TimeRulerFormat property of DaysViewSettings and TimelineViewSettings.
Please refer the below code example for the same,
|
this.scheduler.DaysViewSettings.TimeRulerFormat = "HH mm";
this.scheduler.TimelineViewSettings.TimeRulerFormat = "HH mm"; |
You can also refer our UG documentation for the same,
Query 2: Regarding customizing existing appointment editor
SfScheduler supports to collapse existing appointment editing fields by using AppointmentEditingOptions in AppointmentEditorOpening event.
Please refer the below code example for collapsing Reminder and Resource fields from appointment editor window.
|
this.scheduler.AppointmentEditorOpening += this.OnSchedulerAppointmentEditorOpening;
private void OnSchedulerAppointmentEditorOpening(object sender, AppointmentEditorOpeningEventArgs e)
{
e.AppointmentEditorOptions = AppointmentEditorOptions.All | (~AppointmentEditorOptions.Reminder & ~AppointmentEditorOptions.Resource);
} |
You can also refer our UG documentation for the same,
But if you want to add a new editor field or customize existing filed, you need to create your own appointment editor. Please follow the below steps to create a new appointment editor.
1. Create a new appointment editor window based on requirements.
2. Wire SfScheduler.AppointmentEditorOpening event.
3. In AppointmentEditorOpeing event handler, set e.Cancel = true to cancel the inbuild editor opening. And show the custom editor window as dialog.
4. In custom editor, keep Save button. On save button click, update appointment details from editor values.
5. If editor opening for a new appointment, then you have to create a new appointment object and update values from editor and add appointment object to SfScheduler.ItemSource.
6. If editor opening for existing appointment. On save button click, update Appointment which can be get from AppointmentEditorOpeningEventArgs.Appointment.
7. In custom editor on Save or Cancel button click, close custom editor dialog window.
We have prepared a sample for the custom editor. Kindly check the sample.
Query 3: Regarding saving appointments to SQL database
You can get the new or edited appointment details from AppointmentEditorClosing event of scheduler, so after editor closed get details from event and update it to the SQL database.
Please refer the below code example for the same,
|
this.scheduler.AppointmentEditorClosing += OnSchedulerAppointmentEditorClosing;
private void OnSchedulerAppointmentEditorClosing(object sender, AppointmentEditorClosingEventArgs e)
{
var appointment = e.Appointment;
if (e.Action == AppointmentEditorAction.Add)
{
// Add new appointment to database.
}
else if(e.Action == AppointmentEditorAction.Delete)
{
// Delete appointment from database.
}
else if(e.Action == AppointmentEditorAction.Edit)
{
// Modify appointment data from database.
}
} |
Note: AppointmentEditorClosing event will be triggered only if in-build editor is used. If you have used custom editor, then you need to update database details on Save button click from custom editor window.
We will prepare sample for connecting Scheduler with SQL database and share you on or before 6 April 2021. We appreciate your patience until then.
Please let us know if you require any further assistance on above queries.
Regards,
Karthik Raja A