Class RenderDayCellEventArgs
Provides event arguments for the OnRenderDayCell event when individual day cells are rendered.
Inheritance
Namespace: Syncfusion.Blazor.Calendars
Assembly: Syncfusion.Blazor.dll
Syntax
public class RenderDayCellEventArgs : Object
Remarks
This class contains information about individual day cells as they are rendered in the calendar view. It allows customization of day cell appearance, disabling specific dates, and accessing cell-specific data. This event is fired for each day cell that is rendered in the current calendar view.
Examples
<SfCalendar TValue="DateTime?">
<CalendarEvents TValue="DateTime?" OnRenderDayCell="OnRenderDayCell"></CalendarEvents>
</SfCalendar>
@code {
void OnRenderDayCell(RenderDayCellEventArgs args)
{
// Disable weekends
if (args.Date.DayOfWeek == DayOfWeek.Saturday || args.Date.DayOfWeek == DayOfWeek.Sunday)
{
args.IsDisabled = true;
}
}
}
Constructors
RenderDayCellEventArgs()
Declaration
public RenderDayCellEventArgs()
Properties
CellData
Gets or sets the detailed information about the calendar cell.
Declaration
public CellDetails CellData { get; set; }
Property Value
Type | Description |
---|---|
CellDetails | A CellDetails object containing detailed information about the calendar cell. The default value is |
Remarks
This property provides comprehensive details about the calendar cell, including additional metadata that can be used for advanced customization scenarios. The cell data contains information about the cell's state, position, and other relevant properties.
Date
Gets or sets the date of the day cell being rendered.
Declaration
public DateTime Date { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | A System.DateTime value representing the date of the current day cell being rendered. |
Remarks
This property contains the specific date that corresponds to the day cell being rendered in the calendar view. It can be used to apply conditional logic based on the date, such as highlighting special dates or disabling certain dates.
Element
Gets or sets the DOM element representing the day cell.
Declaration
public DOM Element { get; set; }
Property Value
Type | Description |
---|---|
DOM | A DOM object representing the day cell element in the calendar component. The default value is |
Remarks
This property provides access to the DOM element of the day cell, allowing for direct manipulation of the cell's appearance, styling, or behavior during the rendering process.
IsDisabled
Gets or sets a value indicating whether the current date should be disabled.
Declaration
public bool IsDisabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
This property allows you to programmatically disable specific dates during the cell rendering process.
When set to true
, the date will be displayed as disabled and cannot be selected by users.
This is useful for implementing business rules like disabling weekends or holidays.
IsOutOfRange
Gets or sets a value indicating whether the current date is outside the allowed range.
Declaration
public bool IsOutOfRange { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
This property indicates whether the current date falls outside the minimum and maximum date range configured for the calendar. Dates that are out of range are typically displayed as disabled. This property is automatically set by the calendar based on the Min and Max date configurations.
Name
Gets or sets the name of the render day cell event.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | A |
Remarks
This property specifies the name identifier for the render day cell event, which can be used to identify the specific event type in scenarios where multiple event handlers are used.