New to Telerik UI for .NET MAUIStart a free 30-day trial

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

Constructors

Initializes a new instance of the RadDataForm class.

C#
public RadDataForm()

Fields

Identifies the ActualValidationSummaryImageStyle property.

C#
public static readonly BindableProperty ActualValidationSummaryImageStyleProperty

Identifies the ActualValidationSummaryLabelStyle property.

C#
public static readonly BindableProperty ActualValidationSummaryLabelStyleProperty

Identifies the ActualValidationSummaryStyle property.

C#
public static readonly BindableProperty ActualValidationSummaryStyleProperty

Identifies the AutoGenerateItems property.

C#
public static BindableProperty AutoGenerateItemsProperty

CommitModeProperty

BindableProperty

Identifies the CommitMode property.

C#
public static readonly BindableProperty CommitModeProperty

Identifies the ErrorDisplayOptions property.

C#
public static readonly BindableProperty ErrorDisplayOptionsProperty

ErrorImageSourceProperty

BindableProperty

Identifies the ErrorImageSource property.

C#
public static readonly BindableProperty ErrorImageSourceProperty

ErrorImageStyleProperty

BindableProperty

Identifies the ErrorImageStyle property.

C#
public static readonly BindableProperty ErrorImageStyleProperty

ErrorLabelStyleProperty

BindableProperty

Identifies the ErrorLabelStyle property.

C#
public static readonly BindableProperty ErrorLabelStyleProperty

ErrorLengthProperty

BindableProperty

Identifies the ErrorLength property.

C#
public static readonly BindableProperty ErrorLengthProperty

ErrorPositionProperty

BindableProperty

Identifies the ErrorPosition property.

C#
public static readonly BindableProperty ErrorPositionProperty

Identifies the HasPendingChanges property.

C#
public static readonly BindableProperty HasPendingChangesProperty

Identifies the HasValidationErrors property.

C#
public static readonly BindableProperty HasValidationErrorsProperty

Identifies the HeaderDisplayOptions property.

C#
public static readonly BindableProperty HeaderDisplayOptionsProperty

Identifies the HeaderImageSource property.

C#
public static readonly BindableProperty HeaderImageSourceProperty

HeaderImageStyleProperty

BindableProperty

Identifies the HeaderImageStyle property.

C#
public static readonly BindableProperty HeaderImageStyleProperty

HeaderLabelStyleProperty

BindableProperty

Identifies the HeaderLabelStyle property.

C#
public static readonly BindableProperty HeaderLabelStyleProperty

HeaderLengthProperty

BindableProperty

Identifies the HeaderLength property.

C#
public static readonly BindableProperty HeaderLengthProperty

HeaderPositionProperty

BindableProperty

Identifies the HeaderPosition property.

C#
public static readonly BindableProperty HeaderPositionProperty

Identifies the IsValidationSummaryVisible property.

C#
public static readonly BindableProperty IsValidationSummaryVisibleProperty

LayoutDefinitionProperty

BindableProperty

Identifies the LayoutDefinition property.

C#
public static readonly BindableProperty LayoutDefinitionProperty

ValidationModeProperty

BindableProperty

Identifies the ValidationMode property.

C#
public static readonly BindableProperty ValidationModeProperty

Identifies the ValidationSummaryImageSource property.

C#
public static readonly BindableProperty ValidationSummaryImageSourceProperty

Identifies the ValidationSummaryImageStyle property.

C#
public static readonly BindableProperty ValidationSummaryImageStyleProperty

Identifies the ValidationSummaryLabelStyle property.

C#
public static readonly BindableProperty ValidationSummaryLabelStyleProperty

Identifies the ValidationSummaryStyle property.

C#
public static readonly BindableProperty ValidationSummaryStyleProperty

Properties

Gets the result from merging the Style specified in the ValidationSummaryImageStyle property and the default base Style for that property.

C#
public Style ActualValidationSummaryImageStyle { get; }

Gets the result from merging the Style specified in the ValidationSummaryLabelStyle property and the default base Style for that property.

C#
public Style ActualValidationSummaryLabelStyle { get; }

Gets the result from merging the Style specified in the ValidationSummaryStyle property and the default base Style for that property.

C#
public Style ActualValidationSummaryStyle { get; }

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.

C#
public bool AutoGenerateItems { get; set; }

Gets a command to cancel all pending changes in the RadDataForm. This command is mostly useful when the CommitMode property is set to Explicit.

C#
public ICommand CancelCommand { get; }

Gets a command to commit all pending changes in the RadDataForm. This command is mostly useful when the CommitMode property is set to Explicit.

C#
public ICommand CommitCommand { get; }

Gets or sets the current commit mode of the RadDataForm. For more information see the DataFormCommitMode type.

C#
public DataFormCommitMode CommitMode { get; set; }

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.

C#
public DataFormErrorDisplayOptions? ErrorDisplayOptions { get; set; }

ErrorImageSource

ImageSource

Gets or sets the ImageSource of the error icons.

C#
public ImageSource ErrorImageSource { get; set; }

Gets or sets the Style applied to the error icons. The target type of this Style is .

C#
public Style ErrorImageStyle { get; set; }

Gets or sets the Style applied to the error labels. The target type of this Style is .

C#
public Style ErrorLabelStyle { get; set; }

ErrorLength

GridLength

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.

C#
[TypeConverter(typeof(GridLengthTypeConverter))]
public GridLength ErrorLength { get; set; }

Gets or sets a value specifying the relative position of the error indicators from their associated editors. For more information see the DataFormErrorPosition type.

C#
public DataFormErrorPosition? ErrorPosition { get; set; }

Gets a value indicating whether there are pending changes.

C#
public bool HasPendingChanges { get; }

Gets a value indicating whether there are validation errors.

C#
public bool HasValidationErrors { get; }

Gets or sets the display options of the headers in the editors. For more information see the DataFormHeaderDisplayOptions type.

C#
public DataFormHeaderDisplayOptions? HeaderDisplayOptions { get; set; }

Gets or sets the ImageSource of the header icons.

C#
public ImageSource HeaderImageSource { get; set; }

Gets or sets the Style applied to the header icons. The target type of this Style is .

C#
public Style HeaderImageStyle { get; set; }

Gets or sets the Style applied to the header labels. The target type of this Style is .

C#
public Style HeaderLabelStyle { get; set; }

HeaderLength

GridLength

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.

C#
[TypeConverter(typeof(GridLengthTypeConverter))]
public GridLength HeaderLength { get; set; }

Gets or sets a value specifying the relative position of the header views from their associated editors. For more information see the DataFormHeaderPosition type.

C#
public DataFormHeaderPosition? HeaderPosition { get; set; }

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.

C#
public bool IsValidationSummaryVisible { get; set; }

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.

C#
public IList<DataFormItem> Items { get; }
Remarks:

Available predefined editors include:

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.

C#
public DataFormLayout LayoutDefinition { get; set; }

Gets a command to execute the validation logic of the RadDataForm. This command is mostly useful when the ValidationMode property is set to Explicit.

C#
public ICommand ValidateCommand { get; }

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.

C#
public IReadOnlyList<DataFormValidationError> ValidationErrors { get; }

Gets or sets the current validation mode of the RadDataForm. For more information see the DataFormValidationMode type.

C#
public DataFormValidationMode ValidationMode { get; set; }

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.

C#
public IList<DataFormObjectValidationRule> ValidationRules { get; }

Gets or sets the ImageSource of the image displayed in the validation summary.

C#
public ImageSource ValidationSummaryImageSource { get; set; }

Gets or sets the Style applied to the image of the validation summary. The target type of this Style is .

C#
public Style ValidationSummaryImageStyle { get; set; }

Gets or sets the Style applied to the labels of the validation summary. The target type of this Style is .

C#
public Style ValidationSummaryLabelStyle { get; set; }

Gets or sets the Style applied to the validation summary. The target type of this Style is DataFormValidationSummaryView.

C#
public Style ValidationSummaryStyle { get; set; }

Methods

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.

C#
public void CancelChanges()

Cancels the pending changes in the DataFormEditor for the specified property. This method is mostly useful when the CommitMode property is set to Explicit.

C#
public void CancelChanges(string propertyName)
Parameters:propertyNamestring

Specifies the name of the property to cancel.

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.

C#
public bool CommitChanges()
Returns:

bool

True if the validation passes and the changes are committed successfully, false otherwise.

Commits the pending changes in the DataFormEditor for the specified property. This method is mostly useful when the CommitMode property is set to Explicit.

C#
public bool CommitChanges(string propertyName)
Parameters:propertyNamestring

Specifies the name of the property to commit.

Returns:

bool

True if the validation passes and the changes are committed successfully, false otherwise.

Called when the binding context changes.

C#
protected override void OnBindingContextChanged()

Overrides: RadContentView.OnBindingContextChanged()

Called when the handler changes.

C#
protected override void OnHandlerChanged()

Overrides: RadContentView.OnHandlerChanged()

Executes the validation logic associated with the current RadDataForm. This method is mostly useful when the ValidationMode property is set to Explicit.

C#
public bool ValidateChanges()
Returns:

bool

True if the validation passes, false otherwise.

Validates the pending changes in the DataFormEditor for the specified property. This method is mostly useful when the ValidationMode property is set to Explicit.

C#
public bool ValidateChanges(string propertyName)
Parameters:propertyNamestring

Specifies the name of the property to validate.

Returns:

bool

True if the validation passes, false otherwise.

Events

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.

C#
public event EventHandler<DataFormEditorGeneratedEventArgs> EditorGenerated

Raised when the validation of an editor has completed.

C#
public event EventHandler<DataFormEditorValidationCompletedEventArgs> EditorValidationCompleted

Raised when the value of an editor has changed.

C#
public event EventHandler<DataFormEditorValueChangedEventArgs> EditorValueChanged

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.

C#
public event EventHandler<DataFormGroupGeneratedEventArgs> GroupGenerated

Raised when the validation of the data form has completed.

C#
public event EventHandler<DataFormObjectValidationCompletedEventArgs> ValidationCompleted
In this article
DefinitionConstructorsRadDataForm()FieldsActualValidationSummaryImageStylePropertyActualValidationSummaryLabelStylePropertyActualValidationSummaryStylePropertyAutoGenerateItemsPropertyCommitModePropertyErrorDisplayOptionsPropertyErrorImageSourcePropertyErrorImageStylePropertyErrorLabelStylePropertyErrorLengthPropertyErrorPositionPropertyHasPendingChangesPropertyHasValidationErrorsPropertyHeaderDisplayOptionsPropertyHeaderImageSourcePropertyHeaderImageStylePropertyHeaderLabelStylePropertyHeaderLengthPropertyHeaderPositionPropertyIsValidationSummaryVisiblePropertyLayoutDefinitionPropertyValidationModePropertyValidationSummaryImageSourcePropertyValidationSummaryImageStylePropertyValidationSummaryLabelStylePropertyValidationSummaryStylePropertyPropertiesActualValidationSummaryImageStyleActualValidationSummaryLabelStyleActualValidationSummaryStyleAutoGenerateItemsCancelCommandCommitCommandCommitModeErrorDisplayOptionsErrorImageSourceErrorImageStyleErrorLabelStyleErrorLengthErrorPositionHasPendingChangesHasValidationErrorsHeaderDisplayOptionsHeaderImageSourceHeaderImageStyleHeaderLabelStyleHeaderLengthHeaderPositionIsValidationSummaryVisibleItemsLayoutDefinitionValidateCommandValidationErrorsValidationModeValidationRulesValidationSummaryImageSourceValidationSummaryImageStyleValidationSummaryLabelStyleValidationSummaryStyleMethodsCancelChanges()CancelChanges(string)CommitChanges()CommitChanges(string)OnBindingContextChanged()OnHandlerChanged()ValidateChanges()ValidateChanges(string)EventsEditorGeneratedEditorValidationCompletedEditorValueChangedGroupGeneratedValidationCompleted
Not finding the help you need?
Contact Support