.NET MAUI DatePicker Default Dates
You can define preselected dates both in the DatePicker (the selected date) and in the spinner (the highlighted date).
Defining the Current Date Selection
To define the current date selection:
-
Set the
Date
property of theDateTime?
type. The default value isnull
.<telerik:RadDatePicker Date="2020,05,15" SpinnerFormat="yyy-MMM"/>
-
Add the following namespace:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
Setting the Highlighted Date
To set the highlighted date:
-
Set the
DefaultHighlightedDate
property of typeDateTime
to define theSystem.DateTime
, which will be used to pre-scroll each spinner when theDate
property is set tonull
.<telerik:RadDateTimePicker Date="{x:Null}" DefaultHighlightedDate="2020,05,15" SpinnerFormat="dd/MMM/yyyy"/>
-
Add the following namespace:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
See Also