How to restrict the date navigation to minimum and maximum date range in .NET MAUI Scheduler (SfScheduler)?
The .NET MAUI Scheduler allows you to restrict date navigation within specified minimum and maximum calendar date ranges. This feature ensures that users do not navigate beyond a defined set of dates, providing more control over the scheduling interface. You can define these boundaries using the MinimumDateTime and MaximumDateTime properties.
XAML
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="WorkHour.MainPage" xmlns:scheduler="clr-namespace:Syncfusion.Maui.Scheduler;assembly=Syncfusion.Maui.Scheduler"> <Grid> <scheduler:SfScheduler x:Name="Scheduler" View="Month"/> </Grid> </ContentPage>
CS
public MainPage()
{
InitializeComponent();
this.Scheduler.MinimumDateTime = DateTime.Now.AddDays(-2);
this.Scheduler.MaximumDateTime = DateTime.Now.AddDays(10);
}
Output
|
Conclusion
I hope you enjoyed learning how to set minimum and maximum date ranges in the .NET MAUI Scheduler, thereby controlling date navigation.
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!
