How to programmatically select a date in .NET MAUI Scheduler (SfScheduler)?
The .NET MAUI Scheduler allows you to select the DateTime of timeslot or month cell on interaction. You can also set the same programmatically by using the SelectedDate property of 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 Selected date" Clicked="button_Clicked" Grid.Row="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /> </Grid>
CS
By using the button clicked event, you can change the selected date.
public MainPage() { InitializeComponent(); } private void button_Clicked(object sender, EventArgs e) { this.Scheduler.SelectedDate = DateTime.Today.AddDays(9); }
Output
Conclusion
I hope you enjoyed learning how to programmatically select a date 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!