ClassRadDataForm
The RadDataForm is a customizable component which allows you to easily create an input form for manual data entry of business object data. The individual editors may either be inferred automatically from the metadata of the underlying business object data model or specified manually in XAML or code. The control supports different validation and commit modes, which makes it possible to validate or commit property values one by one or commit the entire data form at once. The control supports a rich set of pre-defined editors out of the box.
Definition
Namespace:Telerik.Maui.Controls
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class RadDataForm : DataFormContentView, IRadContentView, IContentView, IPadding, ICrossPlatformLayout, IView, IElement, ITransform
Inheritance: objectRadContentViewDataFormContentViewRadDataForm
Implements:
Inherited Members
Constructors
RadDataForm()
Initializes a new instance of the RadDataForm class.
Declaration
public RadDataForm()
Fields
ActualValidationSummaryImageStyleProperty
Identifies the ActualValidationSummaryImageStyle property.
Declaration
public static readonly BindableProperty ActualValidationSummaryImageStyleProperty
Field Value
BindableProperty
ActualValidationSummaryLabelStyleProperty
Identifies the ActualValidationSummaryLabelStyle property.
Declaration
public static readonly BindableProperty ActualValidationSummaryLabelStyleProperty
Field Value
BindableProperty
ActualValidationSummaryStyleProperty
Identifies the ActualValidationSummaryStyle property.
Declaration
public static readonly BindableProperty ActualValidationSummaryStyleProperty
Field Value
BindableProperty
AutoGenerateItemsProperty
Identifies the AutoGenerateItems property.
Declaration
public static BindableProperty AutoGenerateItemsProperty
Field Value
BindableProperty
CommitModeProperty
Identifies the CommitMode property.
Declaration
public static readonly BindableProperty CommitModeProperty
Field Value
BindableProperty
ErrorDisplayOptionsProperty
Identifies the ErrorDisplayOptions property.
Declaration
public static readonly BindableProperty ErrorDisplayOptionsProperty
Field Value
BindableProperty
ErrorImageSourceProperty
Identifies the ErrorImageSource property.
Declaration
public static readonly BindableProperty ErrorImageSourceProperty
Field Value
BindableProperty
ErrorImageStyleProperty
Identifies the ErrorImageStyle property.
Declaration
public static readonly BindableProperty ErrorImageStyleProperty
Field Value
BindableProperty
ErrorLabelStyleProperty
Identifies the ErrorLabelStyle property.
Declaration
public static readonly BindableProperty ErrorLabelStyleProperty
Field Value
BindableProperty
ErrorLengthProperty
Identifies the ErrorLength property.
Declaration
public static readonly BindableProperty ErrorLengthProperty
Field Value
BindableProperty
ErrorPositionProperty
Identifies the ErrorPosition property.
Declaration
public static readonly BindableProperty ErrorPositionProperty
Field Value
BindableProperty
HasPendingChangesProperty
Identifies the HasPendingChanges property.
Declaration
public static readonly BindableProperty HasPendingChangesProperty
Field Value
BindableProperty
HasValidationErrorsProperty
Identifies the HasValidationErrors property.
Declaration
public static readonly BindableProperty HasValidationErrorsProperty
Field Value
BindableProperty
HeaderDisplayOptionsProperty
Identifies the HeaderDisplayOptions property.
Declaration
public static readonly BindableProperty HeaderDisplayOptionsProperty
Field Value
BindableProperty
HeaderImageSourceProperty
Identifies the HeaderImageSource property.
Declaration
public static readonly BindableProperty HeaderImageSourceProperty
Field Value
BindableProperty
HeaderImageStyleProperty
Identifies the HeaderImageStyle property.
Declaration
public static readonly BindableProperty HeaderImageStyleProperty
Field Value
BindableProperty
HeaderLabelStyleProperty
Identifies the HeaderLabelStyle property.
Declaration
public static readonly BindableProperty HeaderLabelStyleProperty
Field Value
BindableProperty
HeaderLengthProperty
Identifies the HeaderLength property.
Declaration
public static readonly BindableProperty HeaderLengthProperty
Field Value
BindableProperty
HeaderPositionProperty
Identifies the HeaderPosition property.
Declaration
public static readonly BindableProperty HeaderPositionProperty
Field Value
BindableProperty
IsValidationSummaryVisibleProperty
Identifies the IsValidationSummaryVisible property.
Declaration
public static readonly BindableProperty IsValidationSummaryVisibleProperty
Field Value
BindableProperty
LayoutDefinitionProperty
Identifies the LayoutDefinition property.
Declaration
public static readonly BindableProperty LayoutDefinitionProperty
Field Value
BindableProperty
ValidationModeProperty
Identifies the ValidationMode property.
Declaration
public static readonly BindableProperty ValidationModeProperty
Field Value
BindableProperty
ValidationSummaryImageSourceProperty
Identifies the ValidationSummaryImageSource property.
Declaration
public static readonly BindableProperty ValidationSummaryImageSourceProperty
Field Value
BindableProperty
ValidationSummaryImageStyleProperty
Identifies the ValidationSummaryImageStyle property.
Declaration
public static readonly BindableProperty ValidationSummaryImageStyleProperty
Field Value
BindableProperty
ValidationSummaryLabelStyleProperty
Identifies the ValidationSummaryLabelStyle property.
Declaration
public static readonly BindableProperty ValidationSummaryLabelStyleProperty
Field Value
BindableProperty
ValidationSummaryStyleProperty
Identifies the ValidationSummaryStyle property.
Declaration
public static readonly BindableProperty ValidationSummaryStyleProperty
Field Value
BindableProperty
Properties
ActualValidationSummaryImageStyle
Gets the result from merging the Style specified in the ValidationSummaryImageStyle property and the default base Style for that property.
Declaration
public Style ActualValidationSummaryImageStyle { get; }
Property Value
Style
ActualValidationSummaryLabelStyle
Gets the result from merging the Style specified in the ValidationSummaryLabelStyle property and the default base Style for that property.
Declaration
public Style ActualValidationSummaryLabelStyle { get; }
Property Value
Style
ActualValidationSummaryStyle
Gets the result from merging the Style specified in the ValidationSummaryStyle property and the default base Style for that property.
Declaration
public Style ActualValidationSummaryStyle { get; }
Property Value
Style
AutoGenerateItems
Gets or sets a value indicating whether the RadDataForm should generate its items automatically based on the metadata of the underlying business object data model.
When set to true, the component infers all items from the business object specified with the property. You can control this behavior by annotating the properties of the business object with the various attributes from the System.ComponentModel.DataAnnotations namespace. The items which are specified explicitly in the Items collection can be used to manually override what is generated for specific properties.
When set to false, the component does not generate its items automatically. Only the items specified in the Items collection are populated in the data form.
CancelCommand
Gets a command to cancel all pending changes in the RadDataForm. This command is mostly useful when the CommitMode property is set to Explicit.
CommitCommand
Gets a command to commit all pending changes in the RadDataForm. This command is mostly useful when the CommitMode property is set to Explicit.
CommitMode
Gets or sets the current commit mode of the RadDataForm. For more information see the DataFormCommitMode type.
Declaration
public DataFormCommitMode CommitMode { get; set; }
Property Value
ErrorDisplayOptions
Gets or sets the display options of the error indicator to be visualized next to each editor when there are some validation errors. For more information see the DataFormErrorDisplayOptions type.
Declaration
public DataFormErrorDisplayOptions? ErrorDisplayOptions { get; set; }
Property Value
ErrorImageSource
Gets or sets the ImageSource of the error icons.
Declaration
public ImageSource ErrorImageSource { get; set; }
Property Value
ImageSource
ErrorImageStyle
Gets or sets the Style applied to the error icons. The target type of this Style is .
Declaration
public Style ErrorImageStyle { get; set; }
Property Value
Style
ErrorLabelStyle
Gets or sets the Style applied to the error labels. The target type of this Style is .
Declaration
public Style ErrorLabelStyle { get; set; }
Property Value
Style
ErrorLength
Gets or sets the length of the error indicators in the editors. This property has an effect only when the ErrorPosition property is set to Beside. You can specify absolute values in pixels or weighted values followed by the asterisk symbol "". For instance, the value of "0.1" specifies that the error length should be 10% from the length of the corresponding editor. The special value "Auto" specifies that the error length should be computed automatically for each error indicator, based on the actual error size requirements.
Declaration
[TypeConverter(typeof(GridLengthTypeConverter))]
public GridLength ErrorLength { get; set; }
Property Value
GridLength
ErrorPosition
Gets or sets a value specifying the relative position of the error indicators from their associated editors. For more information see the DataFormErrorPosition type.
Declaration
public DataFormErrorPosition? ErrorPosition { get; set; }
Property Value
HasPendingChanges
Gets a value indicating whether there are pending changes.
HasValidationErrors
Gets a value indicating whether there are validation errors.
HeaderDisplayOptions
Gets or sets the display options of the headers in the editors. For more information see the DataFormHeaderDisplayOptions type.
Declaration
public DataFormHeaderDisplayOptions? HeaderDisplayOptions { get; set; }
Property Value
HeaderImageSource
Gets or sets the ImageSource of the header icons.
Declaration
public ImageSource HeaderImageSource { get; set; }
Property Value
ImageSource
HeaderImageStyle
Gets or sets the Style applied to the header icons. The target type of this Style is .
Declaration
public Style HeaderImageStyle { get; set; }
Property Value
Style
HeaderLabelStyle
Gets or sets the Style applied to the header labels. The target type of this Style is .
Declaration
public Style HeaderLabelStyle { get; set; }
Property Value
Style
HeaderLength
Gets or sets the length of the header views in the editors. This property has an effect only when the HeaderPosition property is set to Beside. You can specify absolute values in pixels or weighted values followed by the asterisk symbol "". For instance, the value of "0.5" specifies that the header length should be 50% from the length of the corresponding editor. The special value "Auto" specifies that the header length should be computed automatically for each header view, based on the actual header size requirements.
Declaration
[TypeConverter(typeof(GridLengthTypeConverter))]
public GridLength HeaderLength { get; set; }
Property Value
GridLength
HeaderPosition
Gets or sets a value specifying the relative position of the header views from their associated editors. For more information see the DataFormHeaderPosition type.
Declaration
public DataFormHeaderPosition? HeaderPosition { get; set; }
Property Value
IsValidationSummaryVisible
Gets or sets a value indicating whether the validation summary is visible in the RadDataForm. The validation summary is useful to visualize all validation errors in one place, especially when the ErrorDisplayOptions property is set to None or Image.
Declaration
public bool IsValidationSummaryVisible { get; set; }
Property Value
Items
Gets a collection of items associated with the current RadDataForm. When AutoGenerateItems is set to false, editors must be manually added to this collection to define the form's input fields. The available predefined editors include:
- DataFormCustomEditor - for custom editor implementations
- DataFormDatePickerEditor - for date selection
- DataFormMultiLineEditor - for multi-line text input
- DataFormRadCheckBoxEditor - for boolean values with checkbox
- DataFormRadComboBoxEditor - for dropdown selection from predefined options
- DataFormRadDatePickerEditor - for date selection with picker
- DataFormRadDateTimePickerEditor - for date-time selection with picker
- DataFormRadEmailMaskedEditor - for email input with validation
- DataFormRadEntryEditor - for single-line text input
- DataFormRadEntryPasswordEditor - for password input with masking
- DataFormRadListPickerEditor - for selection from a list of items
- DataFormRadNumericEditor - for numeric input
- DataFormRadNumericMaskedEditor - for masked numeric input
- DataFormRadRegexMaskedEditor - for input validated by regular expressions
- DataFormRadSegmentedEditor - for selection from predefined segments
- DataFormRadTextMaskedEditor - for masked text input
- DataFormRadTimePickerEditor - for time selection with picker
- DataFormRadTimeSpanPickerEditor - for time span selection with picker
- DataFormSwitchEditor - for boolean values with switch control
- DataFormTimePickerEditor - for time selection
Declaration
public IList<DataFormItem> Items { get; }
Property Value
LayoutDefinition
Gets or sets the layout definition controlling how the individual items are sized and arranged within the RadDataForm. For more information see the inheritors of the DataFormLayout type.
Declaration
public DataFormLayout LayoutDefinition { get; set; }
Property Value
ValidateCommand
Gets a command to execute the validation logic of the RadDataForm. This command is mostly useful when the ValidationMode property is set to Explicit.
ValidationErrors
Gets a collection of validation errors that are produced after the last execution of the validation logic associated with the current RadDataForm. This collection aggregates all validation errors produced by the validation rules from the metadata of the underlying business object data model and all custom validation rules specified to the individual DataFormEditors and the current RadDataForm. For more information see the DataFormValidationError type.
Declaration
public IReadOnlyList<DataFormValidationError> ValidationErrors { get; }
Property Value
ValidationMode
Gets or sets the current validation mode of the RadDataForm. For more information see the DataFormValidationMode type.
Declaration
public DataFormValidationMode ValidationMode { get; set; }
Property Value
ValidationRules
Gets a collection of validation rules associated with the current RadDataForm. The validation rules specified here extend the base set of validation rules that come from the metadata of the underlying business object data model. When the validation logic is triggered, these validation rules are executed last, after executing the validation rules for the individual properties. This makes it possible to execute more advanced validation logic involving multiple properties at once and provide more detailed validation errors. For more information see the inheritors of the DataFormValidationRule type.
Declaration
public IList<DataFormObjectValidationRule> ValidationRules { get; }
Property Value
ValidationSummaryImageSource
Gets or sets the ImageSource of the image displayed in the validation summary.
Declaration
public ImageSource ValidationSummaryImageSource { get; set; }
Property Value
ImageSource
ValidationSummaryImageStyle
Gets or sets the Style applied to the image of the validation summary. The target type of this Style is .
Declaration
public Style ValidationSummaryImageStyle { get; set; }
Property Value
Style
ValidationSummaryLabelStyle
Gets or sets the Style applied to the labels of the validation summary. The target type of this Style is .
Declaration
public Style ValidationSummaryLabelStyle { get; set; }
Property Value
Style
ValidationSummaryStyle
Gets or sets the Style applied to the validation summary. The target type of this Style is DataFormValidationSummaryView.
Declaration
public Style ValidationSummaryStyle { get; set; }
Property Value
Style
Methods
CancelChanges()
Cancels all pending changes in the RadDataForm and reverts to the original values from the underlying business object. This method is mostly useful when the CommitMode property is set to Explicit.
Declaration
public void CancelChanges()
CancelChanges(string)
Cancels the pending changes in the DataFormEditor for the specified property. This method is mostly useful when the CommitMode property is set to Explicit.
Declaration
public void CancelChanges(string propertyName)
Parameters
propertyName
Specifies the name of the property to cancel.
CommitChanges()
Commits all pending changes in the RadDataForm to the underlying business object. This method is mostly useful when the CommitMode property is set to Explicit.
Declaration
public bool CommitChanges()
Returns
True if the validation passes and the changes are committed successfully, false otherwise.
CommitChanges(string)
Commits the pending changes in the DataFormEditor for the specified property. This method is mostly useful when the CommitMode property is set to Explicit.
OnBindingContextChanged()
Called when the binding context changes.
Declaration
protected override void OnBindingContextChanged()
Overrides
OnHandlerChanged()
Called when the handler changes.
Declaration
protected override void OnHandlerChanged()
Overrides
ValidateChanges()
Executes the validation logic associated with the current RadDataForm. This method is mostly useful when the ValidationMode property is set to Explicit.
Declaration
public bool ValidateChanges()
Returns
True if the validation passes, false otherwise.
ValidateChanges(string)
Validates the pending changes in the DataFormEditor for the specified property. This method is mostly useful when the ValidationMode property is set to Explicit.
Events
EditorGenerated
Raised when the data form is about to generate an editor for a given property automatically. This event can be used to customize the automatic generation if editors in the data form, when the AutoGenerateItems property is set to true and there is no editor specified explicitly for the given property in the Items collection. It is possible to customize, replace or discard the generated editor, before it is added to the data form. For more information see the DataFormEditorGeneratedEventArgs type.
Declaration
public event EventHandler<DataFormEditorGeneratedEventArgs> EditorGenerated
Event Value
EditorValidationCompleted
Raised when the validation of an editor has completed.
Declaration
public event EventHandler<DataFormEditorValidationCompletedEventArgs> EditorValidationCompleted
Event Value
EditorValueChanged
Raised when the value of an editor has changed.
Declaration
public event EventHandler<DataFormEditorValueChangedEventArgs> EditorValueChanged
Event Value
GroupGenerated
Raised when the data form is about to generate a group of items automatically. This event can be used to customize the automatic generation if groups in the data form, when the AutoGenerateItems property is set to true and there is no group specified explicitly for the given category in the Items collection. It is possible to customize, replace or discard the generated group, before it is added to the data form. For more information see the DataFormGroupGeneratedEventArgs type.
Declaration
public event EventHandler<DataFormGroupGeneratedEventArgs> GroupGenerated
Event Value
ValidationCompleted
Raised when the validation of the data form has completed.
Declaration
public event EventHandler<DataFormObjectValidationCompletedEventArgs> ValidationCompleted
Event Value