We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Adding Custome fields in New Event Not working

I am trying to add PHN and PatientName as fields in the "New Event" forum. I followed the guide in this link:https://blazor.syncfusion.com/documentation/scheduler/appointments#adding-custom-fields. But it does not work. 

My code:

@page "/"
@using Syncfusion.Blazor.Schedule
@using Syncfusion.Blazor


<SfSchedule TValue=AppointmentData StartHour="09:00" EndHour="18:00">
<ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings>
<ScheduleViews>
<ScheduleView Option="View.Day"></ScheduleView>
<ScheduleView Option="View.Week"></ScheduleView>
<ScheduleView Option="View.Month"></ScheduleView>
<ScheduleView Option="View.Agenda"></ScheduleView>
</ScheduleViews>
<style>
.e-location-container,
.e-time-zone-container {
display: none;
}
</style>
</SfSchedule>

@code {
public class AppointmentData
{
public int Id { get; set; }
public string Subject { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public string PatientName { get; set; }
public string PHN { get; set; }
}

private List<AppointmentData> DataSource = new List<AppointmentData>
{
new AppointmentData { Id = 1, Subject = "Appointment", StartTime = new DateTime(2023, 03, 17, 10, 0, 0), EndTime = new
DateTime(2023, 03, 17, 12, 0, 0), PatientName = "John Doe", PHN = "123456"}
};
}

1 Reply

SR Swathi Ravi Syncfusion Team March 20, 2023 09:39 AM UTC

Hi Nitish,


If you want to use the custom fields in the appointment we suggest you use the Scheduler EditorTemplate to add the custom input fields based on your requirement in the editor window. Refer to the below UG and Demo to know about how to use EditorTemplate.


API: https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Schedule.ScheduleTemplates.html#Syncfusion_Blazor_Schedule_ScheduleTemplates_EditorTemplate

UG: https://blazor.syncfusion.com/documentation/scheduler/editor-template#customizing-event-editor-using-template

Demo: https://blazor.syncfusion.com/demos/scheduler/editor-template?theme=fluent


Regards,

Swathi Ravi


Loader.
Live Chat Icon For mobile
Up arrow icon