How to change the time interval width in .NET MAUI Scheduler timeline view?
The .NET MAUI Scheduler displays the appointments or events based on start and end time intervals in the timeline day, timeline week, timeline workweek view, and timeline month views. You can adjust the appointment interval width using the TimeIntervalWidth property of TimelineView.
This guide demonstrates how to use the ViewChanged event to modify the time interval width based on the current timeline view.
XAML
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="TimeIntervalHeightWidth.MainPage" BackgroundColor="{DynamicResource SecondaryColor}" xmlns:scheduler="clr-namespace:Syncfusion.Maui.Scheduler;assembly=Syncfusion.Maui.Scheduler"> <Grid> <scheduler:SfScheduler x:Name="Scheduler" View="Week" AllowedViews=" TimelineDay,TimelineWeek,TimelineWorkWeek,TimelineMonth"> </scheduler:SfScheduler> </Grid> </ContentPage>
CS
private void Scheduler_ViewChanged(object sender, SchedulerViewChangedEventArgs e) { if (this.Scheduler.View == SchedulerView.TimelineMonth) { this.Scheduler.TimelineView.TimeIntervalWidth = 100; } else { this.Scheduler.TimelineView.TimeIntervalWidth = 60; } }
Output
Conclusion
I hope you enjoyed learning how to change the time interval width in .NET MAUI Scheduler timeline view.
Refer to our .NET MAUI Scheduler feature tour page to learn about its other groundbreaking feature representations. You can explore our .NET MAUI Scheduler documentation to understand how to present and manipulate data.
For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Scheduler and other .NET MAUI components.
Please let us know in the following comments section if you have any queries or require clarifications. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!