How to navigate to adjacent dates in MAUI Scheduler (SfScheduler)?
The .NET MAUI Scheduler allows navigation to adjacent dates programmatically by using the Forward and Backward properties of the scheduler. This guide provides a straightforward implementation to use these features, enhancing the user experience by allowing quick navigation between dates.
XAML
Initialize the scheduler and add buttons to move the scheduler dates forward and backward.
<xmlns:scheduler="clr-namespace:Syncfusion.Maui.Scheduler;assembly=Syncfusion.Maui.Scheduler"> <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition Height="50" /> <RowDefinition Height="50" /> </Grid.RowDefinitions> <scheduler:SfScheduler x:Name="Scheduler" View="Week" > </scheduler:SfScheduler> <Button x:Name="button" Text="Forward" Clicked="OnButtonClicked" Grid.Row="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /> <Button x:Name="button1" Text="Backward" Clicked="button1_Clicked" Grid.Row="2" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /> </Grid>
CS
Define the logic for the button click events to navigate to the next or previous set of visible dates.
public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); } private void OnButtonClicked(object sender, EventArgs e) { this.Scheduler.Forward(); } private void button1_Clicked(object sender, EventArgs e) { this.Scheduler.Backward(); } }
Output
Conclusion
I hope you enjoyed learning how to navigate to adjacent dates in MAUI Scheduler.
You can refer to our .NET MAUI Scheduler feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. Explore our .NET MAUI Scheduler example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!