Articles in this section

How to programmatically change the selected date in WinUI Scheduler?

Initially, the scheduler is loaded with the current day as the selected date, and initialize the scheduler with a specific date by using the SelectedDate property in the WinUI Scheduler.

C#

Create a ViewModel class, and add a SelectedDate property with a specific date.

private DateTime selectedDate = DateTime.Now.AddDays(10);
 
public DateTime SelectedDate
{
    get
    {
        return this.selectedDate;
    }
 
    set
    {
        this.selectedDate = value;
        this.RaiseOnPropertyChanged("SelectedDate");
    }
}

XAML

Bind the SelectedDate ViewModel property to the SelectedDate property in the SfScheduler.

<Grid>
    <Grid.DataContext>
        <local:SchedulerViewModel/>
    </Grid.DataContext>
        
    <scheduler:SfScheduler 
        x:Name="Schedule"
        ViewType="Month"
        SelectedDate="{Binding SelectedDate}">
    </scheduler:SfScheduler>
</Grid>

Calendar

Description automatically generated

Take a moment to pursue the documentation. You can also find the options about programmatic date selection.


Conclusion

I hope you enjoyed learning about how to programmatically change the selected date in WinUI Scheduler (Calendar).

You can refer to our WinUI Scheduler feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our 
WinUI 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 forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied