You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .NET MAUI DatePicker control currently does not support null values for its Date property, which limits its usability in scenarios where dates are optional. Many applications require fields that allow users to leave a date unset or clear a previously selected value, such as "Date of Birth" or "Event Date." This enhancement adds the ability for the DatePicker control to handle nullable DateTime values (DateTime?).
Public API Changes
New Property: AllowNull
Type:bool
Default:false
Description: Determines whether the DatePicker control allows the Date property to be set to null. When set to true, users can clear the date value, and the Date property can reflect null.
Intended Use-Case
Optional Date Fields:
Forms often include optional fields such as "Date of Birth" or "Event Date," where the user should have the flexibility to leave the date unset or clear a previously selected value.
Reset Scenarios:
Applications with reset functionality can use the AllowNull feature to clear date fields without additional code or custom logic.
The text was updated successfully, but these errors were encountered:
Description
The .NET MAUI
DatePicker
control currently does not supportnull
values for itsDate
property, which limits its usability in scenarios where dates are optional. Many applications require fields that allow users to leave a date unset or clear a previously selected value, such as "Date of Birth" or "Event Date." This enhancement adds the ability for theDatePicker
control to handle nullableDateTime
values (DateTime?
).Public API Changes
AllowNull
bool
false
DatePicker
control allows theDate
property to be set tonull
. When set totrue
, users can clear the date value, and theDate
property can reflectnull
.Intended Use-Case
Optional Date Fields:
Forms often include optional fields such as "Date of Birth" or "Event Date," where the user should have the flexibility to leave the date unset or clear a previously selected value.
Reset Scenarios:
Applications with reset functionality can use the
AllowNull
feature to clear date fields without additional code or custom logic.The text was updated successfully, but these errors were encountered: