Class RadDataForm
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.
Inherited Members
Namespace: Telerik.Maui.Controls
Assembly: Telerik.Maui.Controls.dll
Syntax
public class RadDataForm : DataFormContentView, IRadContentView, IContentView, IPadding, ICrossPlatformLayout, IDataFormView, IView, IElement, ITransform
Constructors
RadDataForm()
Fields
ActualValidationSummaryImageStyleProperty
Identifies the ActualValidationSummaryImageStyle property.
Declaration
public static readonly BindableProperty ActualValidationSummaryImageStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ActualValidationSummaryLabelStyleProperty
Identifies the ActualValidationSummaryLabelStyle property.
Declaration
public static readonly BindableProperty ActualValidationSummaryLabelStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ActualValidationSummaryStyleProperty
Identifies the ActualValidationSummaryStyle property.
Declaration
public static readonly BindableProperty ActualValidationSummaryStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
AutoGenerateItemsProperty
Identifies the AutoGenerateItems property.
Declaration
public static BindableProperty AutoGenerateItemsProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
CommitModeProperty
Identifies the CommitMode property.
Declaration
public static readonly BindableProperty CommitModeProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ErrorDisplayOptionsProperty
Identifies the ErrorDisplayOptions property.
Declaration
public static readonly BindableProperty ErrorDisplayOptionsProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ErrorImageSourceProperty
Identifies the ErrorImageSource property.
Declaration
public static readonly BindableProperty ErrorImageSourceProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ErrorImageStyleProperty
Identifies the ErrorImageStyle property.
Declaration
public static readonly BindableProperty ErrorImageStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ErrorLabelStyleProperty
Identifies the ErrorLabelStyle property.
Declaration
public static readonly BindableProperty ErrorLabelStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ErrorLengthProperty
Identifies the ErrorLength property.
Declaration
public static readonly BindableProperty ErrorLengthProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ErrorPositionProperty
Identifies the ErrorPosition property.
Declaration
public static readonly BindableProperty ErrorPositionProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
HasPendingChangesProperty
Identifies the HasPendingChanges property.
Declaration
public static readonly BindableProperty HasPendingChangesProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
HasValidationErrorsProperty
Identifies the HasValidationErrors property.
Declaration
public static readonly BindableProperty HasValidationErrorsProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
HeaderDisplayOptionsProperty
Identifies the HeaderDisplayOptions property.
Declaration
public static readonly BindableProperty HeaderDisplayOptionsProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
HeaderImageSourceProperty
Identifies the HeaderImageSource property.
Declaration
public static readonly BindableProperty HeaderImageSourceProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
HeaderImageStyleProperty
Identifies the HeaderImageStyle property.
Declaration
public static readonly BindableProperty HeaderImageStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
HeaderLabelStyleProperty
Identifies the HeaderLabelStyle property.
Declaration
public static readonly BindableProperty HeaderLabelStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
HeaderLengthProperty
Identifies the HeaderLength property.
Declaration
public static readonly BindableProperty HeaderLengthProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
HeaderPositionProperty
Identifies the HeaderPosition property.
Declaration
public static readonly BindableProperty HeaderPositionProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
IsValidationSummaryVisibleProperty
Identifies the IsValidationSummaryVisible property.
Declaration
public static readonly BindableProperty IsValidationSummaryVisibleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
LayoutDefinitionProperty
Identifies the LayoutDefinition property.
Declaration
public static readonly BindableProperty LayoutDefinitionProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ValidationModeProperty
Identifies the ValidationMode property.
Declaration
public static readonly BindableProperty ValidationModeProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ValidationSummaryImageSourceProperty
Identifies the ValidationSummaryImageSource property.
Declaration
public static readonly BindableProperty ValidationSummaryImageSourceProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ValidationSummaryImageStyleProperty
Identifies the ValidationSummaryImageStyle property.
Declaration
public static readonly BindableProperty ValidationSummaryImageStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ValidationSummaryLabelStyleProperty
Identifies the ValidationSummaryLabelStyle property.
Declaration
public static readonly BindableProperty ValidationSummaryLabelStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
ValidationSummaryStyleProperty
Identifies the ValidationSummaryStyle property.
Declaration
public static readonly BindableProperty ValidationSummaryStyleProperty
Field Value
Microsoft.Maui.Controls.BindableProperty
|
Properties
ActualValidationSummaryImageStyle
Gets the result from merging the Microsoft.Maui.Controls.Style specified in the ValidationSummaryImageStyle property and the default base Microsoft.Maui.Controls.Style for that property.
Declaration
public Style ActualValidationSummaryImageStyle { get; }
Property Value
Microsoft.Maui.Controls.Style
|
ActualValidationSummaryLabelStyle
Gets the result from merging the Microsoft.Maui.Controls.Style specified in the ValidationSummaryLabelStyle property and the default base Microsoft.Maui.Controls.Style for that property.
Declaration
public Style ActualValidationSummaryLabelStyle { get; }
Property Value
Microsoft.Maui.Controls.Style
|
ActualValidationSummaryStyle
Gets the result from merging the Microsoft.Maui.Controls.Style specified in the ValidationSummaryStyle property and the default base Microsoft.Maui.Controls.Style for that property.
Declaration
public Style ActualValidationSummaryStyle { get; }
Property Value
Microsoft.Maui.Controls.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 Microsoft.Maui.Controls.BindableObject.BindingContext 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.
Declaration
public bool AutoGenerateItems { get; set; }
Property Value
System.Boolean
|
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.
Declaration
public ICommand CancelCommand { get; }
Property Value
System.Windows.Input.ICommand
|
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.
Declaration
public ICommand CommitCommand { get; }
Property Value
System.Windows.Input.ICommand
|
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
DataFormCommitMode
|
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 Nullable<DataFormErrorDisplayOptions> ErrorDisplayOptions { get; set; }
Property Value
System.Nullable<DataFormErrorDisplayOptions>
|
ErrorImageSource
Gets or sets the Microsoft.Maui.Controls.ImageSource of the error icons.
Declaration
public ImageSource ErrorImageSource { get; set; }
Property Value
Microsoft.Maui.Controls.ImageSource
|
ErrorImageStyle
Gets or sets the Microsoft.Maui.Controls.Style applied to the error icons. The target type of this Microsoft.Maui.Controls.Style is Microsoft.Maui.Controls.Image.
Declaration
public Style ErrorImageStyle { get; set; }
Property Value
Microsoft.Maui.Controls.Style
|
ErrorLabelStyle
Gets or sets the Microsoft.Maui.Controls.Style applied to the error labels. The target type of this Microsoft.Maui.Controls.Style is Microsoft.Maui.Controls.Label.
Declaration
public Style ErrorLabelStyle { get; set; }
Property Value
Microsoft.Maui.Controls.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
public GridLength ErrorLength { get; set; }
Property Value
Microsoft.Maui.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 Nullable<DataFormErrorPosition> ErrorPosition { get; set; }
Property Value
System.Nullable<DataFormErrorPosition>
|
HasPendingChanges
Gets a value indicating whether there are pending changes.
Declaration
public bool HasPendingChanges { get; }
Property Value
System.Boolean
|
HasValidationErrors
Gets a value indicating whether there are validation errors.
Declaration
public bool HasValidationErrors { get; }
Property Value
System.Boolean
|
HeaderDisplayOptions
Gets or sets the display options of the headers in the editors. For more information see the DataFormHeaderDisplayOptions type.
Declaration
public Nullable<DataFormHeaderDisplayOptions> HeaderDisplayOptions { get; set; }
Property Value
System.Nullable<DataFormHeaderDisplayOptions>
|
HeaderImageSource
Gets or sets the Microsoft.Maui.Controls.ImageSource of the header icons.
Declaration
public ImageSource HeaderImageSource { get; set; }
Property Value
Microsoft.Maui.Controls.ImageSource
|
HeaderImageStyle
Gets or sets the Microsoft.Maui.Controls.Style applied to the header icons. The target type of this Microsoft.Maui.Controls.Style is Microsoft.Maui.Controls.Image.
Declaration
public Style HeaderImageStyle { get; set; }
Property Value
Microsoft.Maui.Controls.Style
|
HeaderLabelStyle
Gets or sets the Microsoft.Maui.Controls.Style applied to the header labels. The target type of this Microsoft.Maui.Controls.Style is Microsoft.Maui.Controls.Label.
Declaration
public Style HeaderLabelStyle { get; set; }
Property Value
Microsoft.Maui.Controls.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
public GridLength HeaderLength { get; set; }
Property Value
Microsoft.Maui.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 Nullable<DataFormHeaderPosition> HeaderPosition { get; set; }
Property Value
System.Nullable<DataFormHeaderPosition>
|
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
System.Boolean
|
Items
Gets a collection of items associated with the current RadDataForm. For more information see the inheritors of the DataFormItem type.
Declaration
public IList<DataFormItem> Items { get; }
Property Value
System.Collections.Generic.IList<DataFormItem>
|
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
DataFormLayout
|
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.
Declaration
public ICommand ValidateCommand { get; }
Property Value
System.Windows.Input.ICommand
|
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
System.Collections.Generic.IReadOnlyList<DataFormValidationError>
|
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
DataFormValidationMode
|
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
System.Collections.Generic.IList<DataFormObjectValidationRule>
|
ValidationSummaryImageSource
Gets or sets the Microsoft.Maui.Controls.ImageSource of the image displayed in the validation summary.
Declaration
public ImageSource ValidationSummaryImageSource { get; set; }
Property Value
Microsoft.Maui.Controls.ImageSource
|
ValidationSummaryImageStyle
Gets or sets the Microsoft.Maui.Controls.Style applied to the image of the validation summary. The target type of this Microsoft.Maui.Controls.Style is Microsoft.Maui.Controls.Image.
Declaration
public Style ValidationSummaryImageStyle { get; set; }
Property Value
Microsoft.Maui.Controls.Style
|
ValidationSummaryLabelStyle
Gets or sets the Microsoft.Maui.Controls.Style applied to the labels of the validation summary. The target type of this Microsoft.Maui.Controls.Style is Microsoft.Maui.Controls.Label.
Declaration
public Style ValidationSummaryLabelStyle { get; set; }
Property Value
Microsoft.Maui.Controls.Style
|
ValidationSummaryStyle
Gets or sets the Microsoft.Maui.Controls.Style applied to the validation summary. The target type of this Microsoft.Maui.Controls.Style is DataFormValidationSummaryView.
Declaration
public Style ValidationSummaryStyle { get; set; }
Property Value
Microsoft.Maui.Controls.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
System.String
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
System.Boolean
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.
Declaration
public bool CommitChanges(string propertyName)
Parameters
System.String
propertyName
Specifies the name of the property to commit. |
Returns
System.Boolean
True if the validation passes and the changes are committed successfully, false otherwise. |
OnBindingContextChanged()
Declaration
protected override void OnBindingContextChanged()
Overrides
OnHandlerChanged()
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
System.Boolean
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.
Declaration
public bool ValidateChanges(string propertyName)
Parameters
System.String
propertyName
Specifies the name of the property to validate. |
Returns
System.Boolean
True if the validation passes, false otherwise. |
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 Type
System.EventHandler<DataFormEditorGeneratedEventArgs>
|
EditorValidationCompleted
Raised when the validation of an editor has completed.
Declaration
public event EventHandler<DataFormEditorValidationCompletedEventArgs> EditorValidationCompleted
Event Type
System.EventHandler<DataFormEditorValidationCompletedEventArgs>
|
EditorValueChanged
Raised when the value of an editor has changed.
Declaration
public event EventHandler<DataFormEditorValueChangedEventArgs> EditorValueChanged
Event Type
System.EventHandler<DataFormEditorValueChangedEventArgs>
|
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 Type
System.EventHandler<DataFormGroupGeneratedEventArgs>
|
ValidationCompleted
Raised when the validation of the data form has completed.
Declaration
public event EventHandler<DataFormObjectValidationCompletedEventArgs> ValidationCompleted
Event Type
System.EventHandler<DataFormObjectValidationCompletedEventArgs>
|