blazor-devexpress-dot-blazor-9bd622af.md
The layout item that displays the Repeat field in the appointment edit form.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public class DxSchedulerRepeatFormLayoutItem :
SchedulerFormLayoutItemBase
You can use the following properties to create a custom edit form for appointments:
Construct the form based on layout items in the same way as when you use the DxFormLayout component. The Scheduler ships with a set of predefined layout items that correspond to items of the default edit form.
Use the DxSchedulerRepeatFormLayoutItem to display the Repeat field.
<DxScheduler StartDate="@DateTime.Today"
DataStorage="@DataStorage"
ActiveViewType="SchedulerViewType.WorkWeek">
<Views>
<DxSchedulerWorkWeekView VisibleTime="@(new DxSchedulerTimeSpanRange(TimeSpan.FromHours(8),
TimeSpan.FromHours(19)))">
@*...*@
</DxSchedulerWorkWeekView>
</Views>
<AppointmentFormLayout >
@*...*@
<DxSchedulerRepeatFormLayoutItem></DxSchedulerRepeatFormLayoutItem>
@*...*@
</AppointmentFormLayout>
</DxScheduler>
For additional information, refer to the following help topic: Custom Appointment Form.
Run Demo: Scheduler - Custom Fields and Appointment Form
You can customize the list of items available in the Appointment form’s Repeat section. To do this, handle the AppointmentFormShowing event and use the RepeatItems property to define the item list.
The following code snippet adds 3 items to the Repeat section: Yearly, Weekly, Never.
<DxScheduler DataStorage="@DataStorage"
AppointmentFormMode="SchedulerAppointmentFormMode.EditForm"
AppointmentFormShowing="OnAppointmentFormShowing">
<DxSchedulerWeekView ShowWorkTimeOnly="true" />
</DxScheduler>
@code {
DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
AppointmentsSource = AppointmentCollection.GetAppointments(),
AppointmentMappings = new DxSchedulerAppointmentMappings() {
Start = "StartDate",
End = "EndDate",
Subject = "Caption",
LabelId = "Label",
StatusId = "Status"
}
};
void OnAppointmentFormShowing(SchedulerAppointmentFormEventArgs args) {
args.FormInfo.RepeatItems = new List<SchedulerRecurrenceType>() {
SchedulerRecurrenceType.Yearly,
SchedulerRecurrenceType.Weekly,
SchedulerRecurrenceType.Never
};
...
}
}
public class Appointment {
public Appointment() {}
public int AppointmentType { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public string Caption { get; set; }
public string Description { get; set; }
public string Location { get; set; }
public int Label { get; set; }
public int Status { get; set; }
public bool AllDay { get; set; }
public string Recurrence { get; set; }
public bool Accepted { get; set; }
}
public static partial class AppointmentCollection {
public static List<Appointment> GetAppointments() {
DateTime date = DateTime.Today;
var dataSource = new List<Appointment>() {
new Appointment {
Caption = "Install New Router in Dev Room",
StartDate = date + (new TimeSpan(0, 10, 0, 0)),
EndDate = date + (new TimeSpan(0, 12, 30, 0)),
Label = 6,
Status = 4
},
new Appointment {
Caption = "Upgrade Personal Computers",
StartDate = date + (new TimeSpan(0, 13, 0, 0)),
EndDate = date + (new TimeSpan(0, 15, 30, 0)),
Label = 1,
Status = 4
},
new Appointment {
Caption = "Website Redesign Plan",
StartDate = date + (new TimeSpan(1, 9, 30, 0)),
EndDate = date + (new TimeSpan(1, 12, 0, 0)),
Label = 1,
Status = 1,
Accepted = true
},
new Appointment {
Caption = "New Brochures",
StartDate = date + (new TimeSpan(1, 13, 30, 0)),
EndDate = date + (new TimeSpan(1, 15, 15, 0)),
Label = 8,
Status = 2,
Accepted = true
},
// ...
};
return dataSource;
}
}
You can also customize the Recurrence form.
Object ComponentBase SchedulerFormLayoutItemBase DxSchedulerRepeatFormLayoutItem
See Also