Hi Miles,
You can achieve
your requirement for multiple datepicker with the same handler without a component reference
variable. But when disabling the dates without weekends in the popup element
using renderdaycell event the year view all the months is disabled and not able
to navigate the month's selection issue is replicated so we suggest you use the
individual component reference to disable the specific date using renderdaycell
event.
Find the code
example without component reference variable:
|
<SfDatePicker TValue="DateTime?" >
<DatePickerEvents
TValue="DateTime?" OnRenderDayCell="@DisableDate"></DatePickerEvents>
</SfDatePicker>
<SfDatePicker TValue="DateTime?" >
<DatePickerEvents
TValue="DateTime?" OnRenderDayCell="@DisableDate"></DatePickerEvents>
</SfDatePicker>
<SfDatePicker TValue="DateTime?" >
<DatePickerEvents
TValue="DateTime?" OnRenderDayCell="@DisableDate"></DatePickerEvents>
</SfDatePicker>
@code {
private void DisableDate(RenderDayCellEventArgs args)
{
if (((int)args.Date.DayOfWeek == 0 || (int)args.Date.DayOfWeek == 6))
{
args.IsDisabled = true;
}
}
}
|
Regards,
Sureshkumar P