I select a date (not the current date) of a calendar (wpf) by code (C#). Now I want to bring this selected date into view. How can I solve that? All the time the current date is in view.
Any ideas to that? Thank you!
You have to set the DisplayDate
property as well.
var date = DateTime.Now.AddYears(-10);
cal.SelectedDate = date;
cal.DisplayDate = date;
You may also want to set the SelectionMode property to set the range of dates allowed (CalendarSelectionMode
enumeration).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With