AppointmentForm.IsAppointmentChanged(Appointment) Method
This method is called automatically to determine whether a user has modified an appointment. If your appointments have custom fields that are editable through that form, override this method to manually compare custom field data.
Namespace: DevExpress.XtraScheduler.UI
Assembly: DevExpress.XtraScheduler.v24.1.dll
NuGet Package: DevExpress.Win.Scheduler
Declaration
Parameters
Name | Type | Description |
---|---|---|
appointment | Appointment | An Appointment object that is the appointment edited in the appointment form. |
Returns
Type | Description |
---|---|
Boolean | true if a custom appointment field is changed for the appointment loaded in the editing form; otherwise, false. |
Remarks
The following code illustrates how to use the IsAppointmentChanged method in a custom form to indicate that a custom field is modified so that the AppointmentFormController object on the form will save the appointment.
string _contacts;
public virtual void LoadFormData(Appointment appointment) {
if (appointment.CustomFields["Contacts"] == null)
mxContacts.Text = "";
else {
_contacts = appointment.CustomFields["Contacts"].ToString();
mxContacts.Text = _contacts;
}
}
public virtual bool SaveFormData(Appointment appointment) {
appointment.CustomFields["Contacts"] = mxContacts.Text;
return true;
}
public virtual bool IsAppointmentChanged(Appointment appointment) {
if (_contacts == appointment.CustomFields["Contacts"].ToString())
return false;
else
return true;
}