|
<EditForm Model="CalendarEventView">
<DataAnnotationsValidator />
<SfDatePicker TValue="DateTime?" Placeholder="Choose a Date" AllowEdit="false" @bind-Value="@CalendarEventView.FromDateTime" @ref="@FromDatePicker">
<DatePickerEvents TValue="DateTime?" Focus="FocusHandlerFromDate"></DatePickerEvents>
</SfDatePicker>
<ValidationMessage For="@(() => CalendarEventView.FromDateTime)" />
</EditForm>
@code {
private SfDatePicker<DateTime?> FromDatePicker { get; set; }
private void FocusHandlerFromDate(Syncfusion.Blazor.Calendars.FocusEventArgs args)
{
this.FromDatePicker.Show();
}
public class CalendarEvent
{
[Required(ErrorMessage = "Value can not be empty")]
public DateTime? FromDateTime { get; set; }
}
CalendarEvent CalendarEventView = new CalendarEvent();
}
|