<SfSchedule TValue="ScheduleData.AppointmentData" Height="650px" AllowDragAndDrop="true" ShowQuickInfo="true" RowAutoHeight="true" SelectedDate="@(new DateTime(2020, 2, 12))">
...
<ScheduleTemplates>
<EditorTemplate>
@{
Color = (context as ScheduleData.AppointmentData).CategoryColor;
}
<input type="hidden" name="color" class="e-field" @bind-value=@Color />
...
</SfSchedule>
@code{
public static string Color { get; set; } = "";
public void OnEditorClose(PopupCloseEventArgs<ScheduleData.AppointmentData> args)
{
if (args.Data != null && args.Type == PopupType.Editor && RecurrenceEditor != null)
{
if(args.Data.CategoryColor == null)
{
args.Data.CategoryColor = Color;
}
args.Data.RecurrenceRule = RecurrenceEditor.Value != null ? RecurrenceEditor.Value.ToString() : "";
}
}
...
} |