How to programmatically navigate to a date in .NET MAUI Scheduler (SfScheduler)?
The .NET MAUI Scheduler allows you to programmatically change the display date, beyond displaying the current date by default. This can be achieved using the DisplayDate property of the Scheduler. This guide demonstrates how to navigate to a specific date in the scheduler.
XAML
<Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition Height="50"/> </Grid.RowDefinitions> <scheduler:SfScheduler x:Name="scheduler" View="Month"/> <Button x:Name="button" Text="Change display date" Clicked="button_Clicked" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Row="1"/> </Grid>
CS
Here, add the button to change the display date by using the DisplayDate property of the scheduler.
public MainPage() { InitializeComponent(); } private void button_Clicked(object sender, EventArgs e) { this.scheduler.DisplayDate = DateTime.Now.AddDays(30); }
Output
Download the complete sample on GitHub
Conclusion
I hope you enjoyed learning how to programmatically navigate to a desired date in the .NET 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!