Skip to main content

AppointmentForm.SaveFormData(Appointment) Method

Override this method in a custom form to save custom fields.

Namespace: DevExpress.XtraScheduler.UI

Assembly: DevExpress.XtraScheduler.v24.1.dll

NuGet Package: DevExpress.Win.Scheduler

Declaration

public virtual bool SaveFormData(
    Appointment appointment
)

Parameters

Name Type Description
appointment Appointment

An Appointment object that is the appointment being edited in the form.

Returns

Type Description
Boolean

true if all data are saved successfully; otherwise, false.

Remarks

When implementing a custom appointment form which descends from AppointmentForm or uses the AppointmentFormController, call the SaveFormData method to save the values of custom appointment fields.

View Example

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;
}
See Also