Unable to refresh dates in Calendar.

I'm showing blocked dates in the calendar based on a filter.
Whenever the filter change I need to redraw the cell in order to indicate the new state.
I can't find any way to do this as the Calendar doesn't redraw if I call StateHasChanged() on the parent component.
Any advice would be appreciated.
The code only works for the initial filter applied to my blocked days.
private void OnRenderDayCellHandler(RenderDayCellEventArgs args)
{
if (ViewModel?.BlockedDays != null)
{
args.IsDisabled = ViewModel.BlockedDays.Contains(args.Date);
}
}

1 Reply 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team March 4, 2021 02:53 AM UTC

Hi Andreas, 

Greetings from Syncfusion support. 

We would like to know you that, we could not dynamically refresh the Calendar component. So we suggest you to dynamically re-render using if condition as provided in the below sample, so that the changes applied in the filter variable will be reflected to Calendar component to disable the dates as per your requirement. 


Please get back us if you need further assistance. 

Regards, 
Ponmani M 


Marked as answer
Loader.
Up arrow icon