How to clear the value of a DataFormDateItem field of a MAUI DataForm?

How to clear the value of a DataFormDateItem field of a MAUI DataForm?

        [DataType(DataType.Date)]

        [Display(Name = "Data de nascimento")]

        public DateTime? dtNascimento

        {

            get => _dtNascimento;

            set => _ = SetProperty(ref _dtNascimento, value);

        }

<dataForm:DataFormDateItem x:Name="dtNascimento" FieldName="dtNascimento" Format="dd/MM/yyyy" ColumnSpan="2" />




3 Replies

VM Vidyalakshmi Mani Syncfusion Team January 7, 2025 02:09 PM UTC

Hi Rogerio,


Thank you for reaching out to us. The Date editor in the MAUI SfDataForm uses the .NET MAUI `DatePicker` control, which does not currently support nullable values or the ability to clear a selected date. Once the .NET MAUI framework introduces this feature for the `DatePicker`, we will incorporate it into the SfDataForm.


We have logged a feature request for this functionality. You can track its progress using the following feedback link: Support-for-nullable-date-values-in-dataformdateitem


We will notify you once the feature is available. Thank you for your patience and understanding.


Regards,

Vidyalakshmi M.




RC Rogerio C Mauri January 8, 2025 12:37 PM UTC

Thanks for the feedback. Until this functionality is implemented in the date control, is there an alternative option for this?


Could you post an example?



VM Vidyalakshmi Mani Syncfusion Team January 9, 2025 01:30 PM UTC

Hi Rogerio,


Currently, there is no alternative solution, as the .NET MAUI DatePicker control does not support nullable values or clearing a selected date. We will notify you once this functionality is implemented. We greatly appreciate your patience in the meantime.


Regards,

Vidyalakshmi M.



Loader.
Up arrow icon