Articles in this section

How to hide the non-working hours in the UWP Schedule (SfSchedule)

You can hide the non-working hours collapse in TimeLineView and DayView by adding hours with the help of CollapsedHours property in UWP SfSchedule.

XAML

Set the ScheduleType as TimeLine

<syncfusion:SfSchedule x:Name="schedule"
                                       ScheduleType="TimeLine">
<interactivity:Interaction.Behaviors>
<local:SchedulerBehavior/>
</interactivity:Interaction.Behaviors>
</syncfusion:SfSchedule>

C#

You can collapse the hours by adding the hours in CollapsedHours collection.

public class SchedulerBehavior : Behavior<SfSchedule>
    {
        SfSchedule schedule;
        protected override void OnAttached()
        {
            base.OnAttached();
            schedule = this.AssociatedObject;
            this.AssociatedObject.CollapsedHours.Add(new ScheduleCollapsedHour()
            {
                StartHour = 1,
                EndHour = 4,
            });
            this.AssociatedObject.CollapsedHours.Add(new ScheduleCollapsedHour()
            {
                StartHour = 6,
                EndHour = 8,
            });
            this.AssociatedObject.CollapsedHours.Add(new ScheduleCollapsedHour()
            {
                StartHour = 9,
                EndHour = 11,
            });
        }
        protected override void OnDetaching()
        {
            base.OnDetaching();    
            this.schedule = null;
        }
    }

View sample in GitHub

Demo image for collapsed hours

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied