OnRenderCell format displaces scheculeviews

<div>
<SfSchedule TValue="AppointmentData" Height="650px" SelectedDate="StartDate.AddDays(0)" @bind-CurrentView="@CurrentView" MaxDate="EndDate" MinDate="StartDate">


<ScheduleEventSettings DataSource="@DataSource" AllowAdding="false" AllowDeleting="false" TValue="AppointmentData">


</ScheduleEventSettings>
<ScheduleViews>
<ScheduleView Option="View.Month" MaxEventsPerRow="2" Readonly="true" ShowWeekend="true"></ScheduleView>
</ScheduleViews>


<ScheduleEvents TValue="AppointmentData" OnRenderCell="@OnRenderCell"></ScheduleEvents>
</SfSchedule>
</div>
}


@code {
public string[] CellCustomClass = { "cell-custom-class" };


public void OnRenderCell(RenderCellEventArgs args)
{
var item = args.Date;


bool exist = DataSource.Any(d => d.StartTime.Month == item.Month && d.StartTime.Day == item.Day);


if (exist)
{
args.CssClasses = new List<string>(CellCustomClass);
}
}
...




1 Reply

VD Vinitha Devi Murugan Syncfusion Team September 9, 2022 07:42 AM UTC

Hi Marc,


Greetings from Syncfusion Support


We have tried to replicate your reported problem by preparing sample with your shared code. But unfortunately, we were unable to replicate the issue at our end. The Scheduler rendered properly at our end. We have shared the working sample for your reference.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/onRenderCellIssue1679665987


Output:



We suspect that you have customized the scheduler cells using "cell-custom-class”   in sample end which may cause the reported issue. We request to share below details to validate the issue further.


Share your complete Schedule related CSS detail.

Try to replicate the issue in above sample or share issue reproducing sample.


Regards,

Vinitha


Loader.
Up arrow icon