I have the similar need, but I need to display different set of fields if editor opens for New Event and different set of fields if Editor is opened for modification.
How can I determine that programmatically?
Hi Naunihal,
We have checked on your query and let you know that you can display different set of fields when the Editor is opened for New Event and for Modifications with the by like the below condition.
[Index.razor]
|
<EditorTemplate> <div> <input type="hidden" name="Id" class="e-field" value="@((context as AppointmentData).Id)" /> @if ((context as AppointmentData).Id == default(int)) //To check if the appointment is already rendered { <table class="custom-event-editor" width="100%" cellpadding="5"> <tbody> <tr> <td class="e-textlabel">Summary</td> <td colspan="4"> <SfTextBox @bind-Value="@((context as AppointmentData).Subject)"></SfTextBox> </td> </tr> <tr> <td class="e-textlabel">From</td> <td colspan="4"> <SfDateTimePicker @bind-Value="@((context as AppointmentData).StartTime)"> </SfDateTimePicker> </td> </tr> <tr> <td class="e-textlabel">To</td> <td colspan="4"> <SfDateTimePicker @bind-Value="@((context as AppointmentData).EndTime)"> </SfDateTimePicker> </td> </tr> <tr> <td class="e-textlabel">Reason</td> <td colspan="4"> <SfTextBox Multiline="true" @bind-Value="@((context as AppointmentData).Description)"> </SfTextBox> </td> </tr> </tbody> </table> } else { <table class="custom-event-editor" width="100%" cellpadding="5"> <tbody> <tr> <td class="e-textlabel">From</td> <td colspan="4"> <SfDateTimePicker @bind-Value="@((context as AppointmentData).StartTime)"></SfDateTimePicker> </td> </tr> <tr> <td class="e-textlabel">To</td> <td colspan="4"> <SfDateTimePicker @bind-Value="@((context as AppointmentData).EndTime)"></SfDateTimePicker> </td> </tr> </tbody> </table> } </div> </EditorTemplate> |
Kindly try the attached sample and let us know if this meets your requirement.
Regards,
Ruksar Moosa Sait