How to programmatically navigate to a view in the .NET MAUI Scheduler (SfScheduler)?
In the .NET MAUI Scheduler, you can programmatically navigate to a specific view by using the View property of the Scheduler.
XAML
Initialize the scheduler with the required properties and add a button to change the view.
<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> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition Height="50"/> </Grid.RowDefinitions> <scheduler:SfScheduler x:Name="Scheduler" View="Week"/> <Button x:Name="button" Text="Change view" Clicked="OnButtonClicked" GridLayout.Row="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /> </Grid> </ContentPage>
CS
Use the button click event to change the scheduler view.
public MainPage()
{
InitializeComponent();
}
private void OnButtonClicked(object sender, EventArgs e)
{
this.Scheduler.View = SchedulerView.Month;
}
Output
|
Conclusion
I hope you enjoyed learning how to programmatically navigate to the different views in the .NET MAUI Scheduler.
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!
