Class SchedulerDaysView
Represents a class which is used to configure all the properties of day, week and workweek views of the SfScheduler.
Inherited Members
Namespace: Syncfusion.Maui.Scheduler
Assembly: Syncfusion.Maui.Scheduler.dll
Syntax
public class SchedulerDaysView : SchedulerTimeSlotView, IThemeElement
Constructors
SchedulerDaysView()
Initializes a new instance of the SchedulerDaysView class.
Declaration
public SchedulerDaysView()
Fields
AllDayAppointmentHeightProperty
Identifies the AllDayAppointmentHeight dependency property.
Declaration
public static readonly BindableProperty AllDayAppointmentHeightProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for AllDayAppointmentHeight dependency property. |
AllDayAppointmentTemplateProperty
Identifies the AllDayAppointmentTemplate dependency property.
Declaration
public static readonly BindableProperty AllDayAppointmentTemplateProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for AllDayAppointmentTemplate dependency property. |
AllowSpannedAppointmentsInTimeSlotsProperty
Identifies the AllowSpannedAppointmentsInTimeSlots dependency property.
Declaration
public static readonly BindableProperty AllowSpannedAppointmentsInTimeSlotsProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for AllowSpannedAppointmentsInTimeSlots dependency property. |
MoreAppointmentsTemplateProperty
Identifies the MoreAppointmentsTemplateProperty dependency property.
Declaration
public static readonly BindableProperty MoreAppointmentsTemplateProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for MoreAppointmentsTemplateProperty dependency property. |
TimeIntervalHeightProperty
Identifies the TimeIntervalHeight dependency property.
Declaration
public static readonly BindableProperty TimeIntervalHeightProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for TimeIntervalHeight dependency property. |
TimeRulerWidthProperty
Identifies the TimeRulerWidth dependency property.
Declaration
public static readonly BindableProperty TimeRulerWidthProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for TimeRulerWidth dependency property. |
Properties
AllDayAppointmentHeight
Gets or sets the height for each all-day appointment to layout within the all-day panel in day, week, and work week views of the SfScheduler.
Declaration
public double AllDayAppointmentHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The default value is 19, which specifies the height of an all-day appointment in day, week, and work week views. |
Remarks
The all-day appointment height can be customized by changing the value of this property to accommodate longer appointment content or improve visibility.
Examples
The below examples show how to use the AllDayAppointmentHeight property of SchedulerDaysView in the SfScheduler.
<schedule:SfScheduler x:Name="Scheduler"
View="Week">
<schedule:SfScheduler.DaysView>
<schedule:SchedulerDaysView AllDayAppointmentHeight="38" />
</schedule:SfScheduler.DaysView>
</schedule:SfScheduler>
See Also
AllDayAppointmentTemplate
Gets or sets the all day appointment template to customize the default UI.
Declaration
public DataTemplate AllDayAppointmentTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
Remarks
By default, the SchedulerAppointment is set as the BindingContext for AllDayAppointmentTemplate for both SchedulerAppointment and custom data object in AppointmentsSource.
Custom data object can be bound in AllDayAppointmentTemplate by using DataItem.
Examples
The following sample used to configure the custom appointments and appointment template.
# [Model.cs](#tab/tabid-5)public class Meeting
{
public string EventName { get; set; }
public DateTime From { get; set; }
public DateTime To { get; set; }
public Brush BackgroundBrush { get; set; }
public string RecurrenceRule { get; set; }
public bool IsAllDay { get; set; }
}
# [C#](#tab/tabid-6)
var customAppointments = new ObservableCollection<Meeting>();
var meeting = new Meeting()
{
EventName = "General Meeting",
From = new DateTime(2022, 2, 25, 09, 0, 0),
To = new DateTime(2022, 2, 25, 10, 0, 0),
BackgroundBrush = Brush.GreenYellow,
IsAllDay = true,
};
customAppointments.Add(meeting);
this.scheduler.AppointmentsSource = customAppointments;
# [XAML](#tab/tabid-7)
<ContentPage.Resources>
<DataTemplate x:Key="allDayAppointmentTemplate">
<Grid Background="{Binding DataItem.BackgroundBrush}">
<Label Text="{Binding DataItem.EventName}" TextColor="Black"/>
</Grid>
</DataTemplate>
</ContentPage.Resources>
<syncfusion:SfScheduler x:Name="scheduler">
<syncfusion:SfScheduler.DaysView>
<syncfusion:SchedulerDaysView AllDayAppointmentTemplate="{StaticResource allDayAppointmentTemplate}"/>
</syncfusion:SfScheduler.DaysView>
<syncfusion:SfScheduler.AppointmentMapping>
<syncfusion:SchedulerAppointmentMapping
Subject="EventName"
StartTime="From"
EndTime="To"
IsAllDay="IsAllDay"
Background="BackgroundBrush"/>
</syncfusion:SfScheduler.AppointmentMapping>
</syncfusion:SfScheduler>
AllowSpannedAppointmentsInTimeSlots
Gets or sets a value indicating whether appointments lasting more than 24 hours should be rendered as per-day segments in the time-slot cells instead of the all-day area.
Declaration
public bool AllowSpannedAppointmentsInTimeSlots { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is |
Remarks
When true, appointments with duration greater than 24 hours are segmented into per-day clones and rendered within the Day/Week/WorkWeek time-slot grid. Each segment represents the appointment's time range clipped to that day's visible hours.
When false (default), multi-day appointments render in the all-day area per existing behavior.
Platform Notes: Applies to Day/Week/WorkWeek views only. Timeline views, Month, and Agenda views are not affected.
Examples
The following sample shows how to enable rendering of spanned appointments in time slots.
# [XAML](#tab/tabid-10)<schedule:SfScheduler x:Name="Scheduler" View="Week">
<schedule:SfScheduler.DaysView>
<schedule:SchedulerDaysView AllowSpannedAppointmentsInTimeSlots="True" />
</schedule:SfScheduler.DaysView>
</schedule:SfScheduler>
# [C#](#tab/tabid-11)
this.Scheduler.View = SchedulerView.Week;
this.Scheduler.DaysView.AllowSpannedAppointmentsInTimeSlots = true;
See Also
MoreAppointmentsTemplate
Gets or sets the all day more appointments template to customize the default UI.
Declaration
public DataTemplate MoreAppointmentsTemplate { get; set; }
Property Value
| Type |
|---|
| Microsoft.Maui.Controls.DataTemplate |
Remarks
The BindingContext of the MoreAppointmentsTemplate is expandable more appointments count value in the all day layout. The MoreAppointmentsTemplate does not support data template selector.
Examples
The following sample used to configure the more appointments template.
#[C#](#tab/tabid-8)var schedulerAppointments = new ObservableCollection<SchedulerAppointment>()
for (int i = 0; i < 5; i++)
{
var schedulerAppointment = new SchedulerAppointment()
{
Subject = "General Meeting",
StartTime = new DateTime(2022, 04, 30, 09, 0, 0),
EndTime = new DateTime(2022, 04, 30, 10, 0, 0),
Background = Brush.GreenYellow,
IsAllDay = true,
};
schedulerAppointments.Add(schedulerAppointment);
}
this.Scheduler.AppointmentsSource = schedulerAppointments;
# [XAML](#tab/tabid-9)
<syncfusion:SfScheduler x:Name="Scheduler">
<syncfusion:SfScheduler.DaysView>
<syncfusion:SchedulerDaysView>
<syncfusion:SchedulerDaysView.MoreAppointmentsTemplate>
<DataTemplate>
<Grid Background="LightBlue" Margin="1">
<Label Text="{Binding StringFormat=+{0}}" TextColor="Black"/>
</Grid>
</DataTemplate>
</syncfusion:SchedulerDaysView.MoreAppointmentsTemplate>
</syncfusion:SchedulerDaysView>
</syncfusion:SfScheduler.DaysView>
</syncfusion:SfScheduler>
TimeIntervalHeight
Gets or sets the height for each time slot cell to layout within this in day, week, and work week views of the SfScheduler.
Declaration
public double TimeIntervalHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The default value is 50 used to specify the time interval height for day, week and workweek views. |
Remarks
The time interval height can be adjusted based on screen height by changing the value of this property to -1. It will auto-fit to the screen height and width.
Examples
The below examples shows, how to use the TimeIntervalHeight property of SchedulerDaysView in the SfScheduler.
<schedule:SfScheduler x:Name="Scheduler"
View="Week">
<schedule:SfScheduler.DaysView>
<schedule:SchedulerDaysView TimeIntervalHeight = "120" />
</ schedule:SfScheduler.DaysView>
</schedule:SfScheduler>
See Also
TimeRulerWidth
Gets or sets the width for the time ruler view to layout within this in day, week, and work week views of the SfScheduler.
Declaration
public double TimeRulerWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The default value is 60 used to specify the time ruler width for day, week and workweek views. |
Remarks
Examples
The below examples shows, how to use the TimeRulerWidth property of SchedulerDaysView in the SfScheduler.
<schedule:SfScheduler x:Name="Scheduler"
View="Week">
<schedule:SfScheduler.DaysView>
<schedule:SchedulerDaysView TimeRulerWidth = "120" />
</ schedule:SfScheduler.DaysView>
</schedule:SfScheduler>