alexa
Syncfusion
menu Syncfusion

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class DataFormDateRangeAttribute

    Specifies the date range constraints for the value of a data field.

    Inheritance
    object
    Attribute
    ValidationAttribute
    DataFormDateRangeAttribute
    Inherited Members
    Attribute.Equals(object)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetHashCode()
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.Match(object)
    Attribute.TypeId
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    ValidationAttribute.ErrorMessage
    ValidationAttribute.ErrorMessageResourceName
    ValidationAttribute.ErrorMessageResourceType
    ValidationAttribute.FormatErrorMessage(string)
    ValidationAttribute.GetValidationResult(object, ValidationContext)
    ValidationAttribute.RequiresValidationContext
    ValidationAttribute.Validate(object, string)
    ValidationAttribute.Validate(object, ValidationContext)
    Namespace: Syncfusion.Maui.DataForm
    Assembly: Syncfusion.Maui.DataForm.dll
    Syntax
    [AttributeUsage(AttributeTargets.Property)]
    public sealed class DataFormDateRangeAttribute : ValidationAttribute

    Constructors

    DataFormDateRangeAttribute()

    Initializes a new instance of the DataFormDateRangeAttribute class.

    Declaration
    public DataFormDateRangeAttribute()

    Properties

    DisplayFormat

    Gets or sets the attribute date display format of date editor.

    Declaration
    public string DisplayFormat { get; set; }
    Property Value
    Type Description
    string

    The default value is "dd/MM/yyyy".

    Examples

    The below examples shows, how to set the DisplayFormat property of DataFormDateRangeAttribute in the SfDataForm.

    • XAML
    • C#
    • C#
    • C#
    <dataForm:SfDataForm x:Name="dataForm"
                         DataObject="{Binding DateInfo}">
       <dataForm:SfDataForm.BindingContext>
         <local:DataFormViewModel/>
       </dataForm:SfDataForm.BindingContext>
    </dataForm:SfDataForm>
    public class DataFormViewModel
    {
       public DateInfo DateInfo { get;set; }
    }
    public class DateInfo
    {
      [DataFormDateRange(DisplayFormat = "dd/MMM/yyyy")]
       public DateTime JoinDate { get; set; }
    }
    this.dataForm.DataObject = new DataFormViewModel().DateInfo;

    MaximumDate

    Gets or sets the maximum date that users can assign to the date editor.

    Declaration
    public string MaximumDate { get; set; }
    Property Value
    Type Description
    string

    The default value is Empty.

    Examples

    The below examples shows, how to set the MaximumDate property of DataFormDateRangeAttribute in the SfDataForm.

    • XAML
    • C#
    • C#
    • C#
    <dataForm:SfDataForm x:Name="dataForm"
                         DataObject="{Binding DateInfo}">
       <dataForm:SfDataForm.BindingContext>
         <local:DataFormViewModel/>
       </dataForm:SfDataForm.BindingContext>
    </dataForm:SfDataForm>
    public class DataFormViewModel
    {
      public DateInfo DateInfo { get;set; }
    }
    public class DateInfo
    {
       [DataFormDateRange(MaximumDate = "01/11/2022")]
       public DateTime JoinDate { get; set; }
    }
    this.dataForm.DataObject = new DataFormViewModel().DateInfo;

    MinimumDate

    Gets or sets the minimum date that users can assign to the date editor.

    Declaration
    public string MinimumDate { get; set; }
    Property Value
    Type Description
    string

    The default value is Empty.

    Examples

    The below examples shows, how to set the MinimumDate property of DataFormDateRangeAttribute in the SfDataForm.

    • XAML
    • C#
    • C#
    • C#
    <dataForm:SfDataForm x:Name="dataForm"
                         DataObject="{Binding DateInfo}">
       <dataForm:SfDataForm.BindingContext>
         <local:DataFormViewModel/>
       </dataForm:SfDataForm.BindingContext>
    </dataForm:SfDataForm>
    public class DataFormViewModel
    {
       public DateInfo DateInfo { get;set; }
    }
    public class DateInfo
    {
       [DataFormDateRange(MinimumDate = "01/01/2022")]
       public DateTime JoinDate { get; set; }
    }
    this.dataForm.DataObject = new DataFormViewModel().DateInfo;

    Methods

    IsValid(object?)

    Checks that the value of the data field is in the specified range.

    Declaration
    public override bool IsValid(object? value)
    Parameters
    Type Name Description
    object value

    The data field value to validate.

    Returns
    Type Description
    bool

    True if the specified value is in the range; otherwise, false.

    Overrides
    ValidationAttribute.IsValid(object)
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved