Back to Devexpress

SchedulerAppointmentFormInfo Class

blazor-devexpress-dot-blazor-f0f3721b.md

latest4.2 KB
Original Source

SchedulerAppointmentFormInfo Class

Stores information about the appointment edit form.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public class SchedulerAppointmentFormInfo :
    INotifyPropertyChanged

The following members return SchedulerAppointmentFormInfo objects:

Remarks

The appointment edit form appears when you create or edit an appointment.

You can use the AppointmentFormLayout and AppointmentCompactFormLayout properties to create a custom appointment form. These properties accept a SchedulerAppointmentFormInfo class object as the Context parameter. You can use this parameter in the template of a custom layout item (DxSchedulerCustomFormLayoutItem) to get an appointment’s settings.

A SchedulerAppointmentFormInfo class object is also passed as the FormInfo argument to the AppointmentFormShowing event. If an appointment contains custom properties, you should implement a SchedulerAppointmentFormInfo descendant, declare the corresponding properties in the class, and then assign a custom descendant instance to the FormInfo argument.

For additional information, refer to the following help topic: Custom Appointment Form.

razor
<DxScheduler StartDate="@DateTime.Today"
             DataStorage="@DataStorage"
             ActiveViewType="SchedulerViewType.WorkWeek"
             AppointmentFormShowing="OnAppointmentFormShowing">
    @*...*@
    <AppointmentFormLayout Context="formInfo">
        @*...*@
        <DxSchedulerCustomFormLayoutItem ColSpanMd="12">
            <Template>
                <div class="my-margin">
                    <DxCheckBox @bind-Checked="@(((CustomAppointmentFormInfo)formInfo).IsAccepted)" 
                                Alignment="CheckBoxContentAlignment.Right">Accept</DxCheckBox>
                </div>
            </Template>
        </DxSchedulerCustomFormLayoutItem>
    </AppointmentFormLayout>

</DxScheduler>

@code {
    DxScheduler scheduler { get; set; }

    public class CustomAppointmentFormInfo : SchedulerAppointmentFormInfo {
        public CustomAppointmentFormInfo(DxSchedulerAppointmentItem AppointmentItem, 
                DxSchedulerDataStorage DataStorage, DxScheduler scheduler) : base(AppointmentItem, DataStorage, scheduler) { }

        public bool IsAccepted {
            get { return (bool)CustomFields["IsAccepted"]; }
            set { CustomFields["IsAccepted"] = value; }
        }
    }

    void OnAppointmentFormShowing(SchedulerAppointmentFormEventArgs args) {
        args.FormInfo = new CustomAppointmentFormInfo(args.Appointment, DataStorage, scheduler);
    }
    // ...
}
css
.my-margin {
    margin-left: auto; 
    margin-top: 14px;
}

Implements

INotifyPropertyChanged

Inheritance

Object SchedulerAppointmentFormInfo

See Also

SchedulerAppointmentFormInfo Members

DevExpress.Blazor Namespace