Class DataFormDateRangeAttribute
Specifies the date range constraints for the value of a data field.
Inheritance
Namespace: Syncfusion.Maui.DataForm
Assembly: Syncfusion.Maui.DataForm.dll
Syntax
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 |
---|---|
System.String | The default value is |
Examples
The below examples shows, how to set the DisplayFormat property of DataFormDateRangeAttribute in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
DataObject="{Binding DateInfo}">
<dataForm:SfDataForm.BindingContext>
<local:DataFormViewModel/>
</dataForm:SfDataForm.BindingContext>
</dataForm:SfDataForm>
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 |
---|---|
System.String | The default value is |
Examples
The below examples shows, how to set the MaximumDate property of DataFormDateRangeAttribute in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
DataObject="{Binding DateInfo}">
<dataForm:SfDataForm.BindingContext>
<local:DataFormViewModel/>
</dataForm:SfDataForm.BindingContext>
</dataForm:SfDataForm>
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 |
---|---|
System.String | The default value is |
Examples
The below examples shows, how to set the MinimumDate property of DataFormDateRangeAttribute in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
DataObject="{Binding DateInfo}">
<dataForm:SfDataForm.BindingContext>
<local:DataFormViewModel/>
</dataForm:SfDataForm.BindingContext>
</dataForm:SfDataForm>
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 |
---|---|---|
System.Object | value | The data field value to validate. |
Returns
Type | Description |
---|---|
System.Boolean | True if the specified value is in the range; otherwise, false. |