I would like to check if the value of a DatePicker
is null (== no date in the box).
By default the Text
of my DatePicker
is set to something like Select a date
, so I can't use the Text
property to check.
I would like to check if the value of a DatePicker
is null (== no date in the box).
By default the Text
of my DatePicker
is set to something like Select a date
, so I can't use the Text
property to check.
Although the default text of the
DatePicker
isSelect a date
but you can use theText
property to check by usingText.Length
. Or checkSelectedDate
property like this:Or:
In pure JS it would simply be
The DatePicker class has a property, SelectedDate, which enable you to get or set the selected date. If there is none selected, it means its value will be null.