menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DataFormDateItem - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DataFormDateItem

    Represents the class that encapsulates the layout and date picker editor settings for a data field.

    Inheritance
    System.Object
    DataFormViewItem
    DataFormItem
    DataFormDateItem
    Inherited Members
    DataFormItem.Background
    DataFormItem.BackgroundProperty
    DataFormItem.DefaultLayoutSettings
    DataFormItem.DefaultLayoutSettingsProperty
    DataFormItem.EditorHeight
    DataFormItem.EditorHeightProperty
    DataFormItem.EditorTextStyle
    DataFormItem.EditorTextStyleProperty
    DataFormItem.ErrorLabelTextStyle
    DataFormItem.ErrorLabelTextStyleProperty
    DataFormItem.FieldName
    DataFormItem.FieldNameProperty
    DataFormItem.GetValue()
    DataFormItem.GroupName
    DataFormItem.GroupNameProperty
    DataFormItem.IsReadOnly
    DataFormItem.IsReadOnlyProperty
    DataFormItem.IsValid
    DataFormItem.ItemsOrderInRow
    DataFormItem.ItemsOrderInRowProperty
    DataFormItem.LabelText
    DataFormItem.LabelTextProperty
    DataFormItem.LabelTextStyle
    DataFormItem.LabelTextStyleProperty
    DataFormItem.LayoutType
    DataFormItem.LayoutTypeProperty
    DataFormItem.LeadingView
    DataFormItem.LeadingViewPosition
    DataFormItem.LeadingViewPositionProperty
    DataFormItem.LeadingViewProperty
    DataFormItem.OnBindingContextChanged()
    DataFormItem.PlaceholderColor
    DataFormItem.PlaceholderColorProperty
    DataFormItem.PlaceholderText
    DataFormItem.PlaceholderTextProperty
    DataFormItem.PropertyInfo
    DataFormItem.SetValue(Object)
    DataFormItem.ShowErrorLabel
    DataFormItem.ShowErrorLabelProperty
    DataFormItem.ShowLabel
    DataFormItem.ShowLabelProperty
    DataFormItem.ShowLeadingView
    DataFormItem.ShowLeadingViewProperty
    DataFormItem.ShowTrailingView
    DataFormItem.ShowTrailingViewProperty
    DataFormItem.ShowValidMessageLabel
    DataFormItem.ShowValidMessageLabelProperty
    DataFormItem.TextInputLayoutSettings
    DataFormItem.TextInputLayoutSettingsProperty
    DataFormItem.TrailingView
    DataFormItem.TrailingViewPosition
    DataFormItem.TrailingViewPositionProperty
    DataFormItem.TrailingViewProperty
    DataFormItem.ValidMessageLabelTextStyle
    DataFormItem.ValidMessageLabelTextStyleProperty
    DataFormViewItem.ColumnSpan
    DataFormViewItem.ColumnSpanProperty
    DataFormViewItem.IsVisible
    DataFormViewItem.IsVisibleProperty
    DataFormViewItem.OnPropertyChanged(String)
    DataFormViewItem.Padding
    DataFormViewItem.PaddingProperty
    DataFormViewItem.RowOrder
    DataFormViewItem.RowOrderProperty
    DataFormViewItem.RowSpan
    DataFormViewItem.RowSpanProperty
    Namespace: Syncfusion.Maui.DataForm
    Assembly: Syncfusion.Maui.DataForm.dll
    Syntax
    public class DataFormDateItem : DataFormItem, IThemeElement

    Constructors

    DataFormDateItem()

    Initializes a new instance of the DataFormDateItem class.

    Declaration
    public DataFormDateItem()

    Fields

    FormatProperty

    Identifies the Format dependency property.

    Declaration
    public static readonly BindableProperty FormatProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for Format dependency property.

    MaximumDisplayDateProperty

    Identifies the MaximumDisplayDate dependency property.

    Declaration
    public static readonly BindableProperty MaximumDisplayDateProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for MaximumDisplayDate dependency property.

    MinimumDisplayDateProperty

    Identifies the MinimumDisplayDate dependency property.

    Declaration
    public static readonly BindableProperty MinimumDisplayDateProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for MinimumDisplayDate dependency property.

    Properties

    Format

    Gets or sets the time format for time picker.

    Declaration
    public string Format { get; set; }
    Property Value
    Type Description
    System.String

    The default value of Format is "d".

    Examples

    The below examples shows, how to use the Format property of DataFormDateItem in the SfDataForm.

    • XAML
    • C#
    • C#
    • C#
    • C#
    <dataForm:SfDataForm x:Name="dataForm">
    </dataForm:SfDataForm>
    public class DataFormViewModel
    {
       public DateInfo DateInfo { get;set; }
    }
    public class DateInfo
    {
        public DateTime Date { get; set; }
    }
    this.dataForm.AutoGenerateItems = true;
    this.dataForm.DataObject = new DataFormViewModel().DateInfo;
    this.dataForm.GenerateDataFormItem += OnDataFormGenerateDataFormItem;
    private void OnDataFormGenerateDataFormItem(object sender, GenerateDataFormItemEventArgs e)
    {
       if (e.DataFormItem != null && e.DataFormItem is DataFormDateItem dateItem)
       {
           dateItem.Format ="dd";
       }
    }
    this.dataForm.AutoGenerateItems = false;
    this.dataForm.Items.Add(new DataFormDateItem() { Format = "dd", FieldName = "Date" });
    See Also
    DataObject
    Items
    MinimumDisplayDate
    MaximumDisplayDate

    MaximumDisplayDate

    Gets or sets the maximun display date to restrict the visible dates of the date editor.

    Declaration
    public DateTime MaximumDisplayDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    The default value is System.DateTime.MaxValue.

    Examples

    The below examples shows, how to use the MaximumDisplayDate property of DataFormDateItem in the SfDataForm.

    • XAML
    • C#
    • C#
    • C#
    • C#
    <dataForm:SfDataForm x:Name="dataForm">
    </dataForm:SfDataForm>
    public class DataFormViewModel
    {
        public DateInfo DateInfo { get;set; }
    }
    public class DateInfo
    {
        public DateTime Date { get; set; }
    }
    this.dataForm.DataObject = new DataFormViewModel().DateInfo;
    this.dataForm.GenerateDataFormItem += OnDataFormGenerateDataFormItem;
    private void OnDataFormGenerateDataFormItem(object sender, GenerateDataFormItemEventArgs e)
    {
       if (e.DataFormItem != null && e.DataFormItem is DataFormDateItem dateItem)
       {
           dateItem.MaximumDisplayDate = DateTime.Today.AddDays(10);
       }
    }
    this.dataForm.AutoGenerateItems = false;
    this.dataForm.Items.Add(new DataFormDateItem() { MaximumDisplayDate = DateTime.Today.AddDays(10), FieldName = "Date" });
    See Also
    DataObject
    Items
    MinimumDisplayDate
    Format

    MinimumDisplayDate

    Gets or sets the minimum display date to restrict the visible dates of the date editor.

    Declaration
    public DateTime MinimumDisplayDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    The default value is System.DateTime.MinValue.

    Examples

    The below examples shows, how to use the MinimumDisplayDate property of DataFormDateItem in the SfDataForm.

    • XAML
    • C#
    • C#
    • C#
    • C#
    <dataForm:SfDataForm x:Name="dataForm">
    </dataForm:SfDataForm>
    public class DataFormViewModel
    {
        public DateInfo DateInfo { get;set; }
    }
    public class DateInfo
    {
        public DateTime Date { get; set; }
    }
    this.dataForm.DataObject = new DataFormViewModel().DateInfo;
    this.dataForm.GenerateDataFormItem += OnDataFormGenerateDataFormItem;
    private void OnDataFormGenerateDataFormItem(object sender, GenerateDataFormItemEventArgs e)
    {
       if (e.DataFormItem != null && e.DataFormItem is DataFormDateItem dateItem)
       {
           dateItem.MinimumDisplayDate = DateTime.Today.AddDays(-10);
       }
    }
    this.dataForm.AutoGenerateItems = false;
    this.dataForm.Items.Add(new DataFormDateItem() { MinimumDisplayDate = DateTime.Today.AddDays(-10), FieldName = "Date" });
    See Also
    DataObject
    Items
    MaximumDisplayDate
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved