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.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class RadDataForm : DataFormContentView, IRadContentView, IContentView, IPadding, ICrossPlatformLayout, IView, IElement, ITransform

Inheritance: objectRadContentViewDataFormContentViewRadDataForm

Implements: IContentViewICrossPlatformLayoutIElementIPaddingIRadContentViewITransformIView

Inherited Members DataFormContentView.BackgroundColorPropertyDataFormContentView.BorderColorPropertyDataFormContentView.BorderThicknessPropertyDataFormContentView.CornerRadiusPropertyDataFormContentView.ContentPaddingPropertyDataFormContentView.BackgroundColorDataFormContentView.BorderColorDataFormContentView.BorderThicknessDataFormContentView.CornerRadiusDataFormContentView.ContentPaddingRadContentView.ActualStyleClassPropertyRadContentView.OnChildAdded(Element)RadContentView.OnChildRemoved(Element, int)

Constructors

RadDataForm()

Initializes a new instance of the RadDataForm class.

Declaration

cs-api-definition
public RadDataForm()

Fields

ActualValidationSummaryImageStyleProperty

Identifies the ActualValidationSummaryImageStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty ActualValidationSummaryImageStyleProperty

Field Value

BindableProperty

ActualValidationSummaryLabelStyleProperty

Identifies the ActualValidationSummaryLabelStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty ActualValidationSummaryLabelStyleProperty

Field Value

BindableProperty

ActualValidationSummaryStyleProperty

Identifies the ActualValidationSummaryStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty ActualValidationSummaryStyleProperty

Field Value

BindableProperty

AutoGenerateItemsProperty

Identifies the AutoGenerateItems property.

Declaration

cs-api-definition
public static BindableProperty AutoGenerateItemsProperty

Field Value

BindableProperty

CommitModeProperty

Identifies the CommitMode property.

Declaration

cs-api-definition
public static readonly BindableProperty CommitModeProperty

Field Value

BindableProperty

ErrorDisplayOptionsProperty

Identifies the ErrorDisplayOptions property.

Declaration

cs-api-definition
public static readonly BindableProperty ErrorDisplayOptionsProperty

Field Value

BindableProperty

ErrorImageSourceProperty

Identifies the ErrorImageSource property.

Declaration

cs-api-definition
public static readonly BindableProperty ErrorImageSourceProperty

Field Value

BindableProperty

ErrorImageStyleProperty

Identifies the ErrorImageStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty ErrorImageStyleProperty

Field Value

BindableProperty

ErrorLabelStyleProperty

Identifies the ErrorLabelStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty ErrorLabelStyleProperty

Field Value

BindableProperty

ErrorLengthProperty

Identifies the ErrorLength property.

Declaration

cs-api-definition
public static readonly BindableProperty ErrorLengthProperty

Field Value

BindableProperty

ErrorPositionProperty

Identifies the ErrorPosition property.

Declaration

cs-api-definition
public static readonly BindableProperty ErrorPositionProperty

Field Value

BindableProperty

HasPendingChangesProperty

Identifies the HasPendingChanges property.

Declaration

cs-api-definition
public static readonly BindableProperty HasPendingChangesProperty

Field Value

BindableProperty

HasValidationErrorsProperty

Identifies the HasValidationErrors property.

Declaration

cs-api-definition
public static readonly BindableProperty HasValidationErrorsProperty

Field Value

BindableProperty

HeaderDisplayOptionsProperty

Identifies the HeaderDisplayOptions property.

Declaration

cs-api-definition
public static readonly BindableProperty HeaderDisplayOptionsProperty

Field Value

BindableProperty

HeaderImageSourceProperty

Identifies the HeaderImageSource property.

Declaration

cs-api-definition
public static readonly BindableProperty HeaderImageSourceProperty

Field Value

BindableProperty

HeaderImageStyleProperty

Identifies the HeaderImageStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty HeaderImageStyleProperty

Field Value

BindableProperty

HeaderLabelStyleProperty

Identifies the HeaderLabelStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty HeaderLabelStyleProperty

Field Value

BindableProperty

HeaderLengthProperty

Identifies the HeaderLength property.

Declaration

cs-api-definition
public static readonly BindableProperty HeaderLengthProperty

Field Value

BindableProperty

HeaderPositionProperty

Identifies the HeaderPosition property.

Declaration

cs-api-definition
public static readonly BindableProperty HeaderPositionProperty

Field Value

BindableProperty

IsValidationSummaryVisibleProperty

Identifies the IsValidationSummaryVisible property.

Declaration

cs-api-definition
public static readonly BindableProperty IsValidationSummaryVisibleProperty

Field Value

BindableProperty

LayoutDefinitionProperty

Identifies the LayoutDefinition property.

Declaration

cs-api-definition
public static readonly BindableProperty LayoutDefinitionProperty

Field Value

BindableProperty

ValidationModeProperty

Identifies the ValidationMode property.

Declaration

cs-api-definition
public static readonly BindableProperty ValidationModeProperty

Field Value

BindableProperty

ValidationSummaryImageSourceProperty

Identifies the ValidationSummaryImageSource property.

Declaration

cs-api-definition
public static readonly BindableProperty ValidationSummaryImageSourceProperty

Field Value

BindableProperty

ValidationSummaryImageStyleProperty

Identifies the ValidationSummaryImageStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty ValidationSummaryImageStyleProperty

Field Value

BindableProperty

ValidationSummaryLabelStyleProperty

Identifies the ValidationSummaryLabelStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty ValidationSummaryLabelStyleProperty

Field Value

BindableProperty

ValidationSummaryStyleProperty

Identifies the ValidationSummaryStyle property.

Declaration

cs-api-definition
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

cs-api-definition
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

cs-api-definition
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

cs-api-definition
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.

Declaration

cs-api-definition
public bool AutoGenerateItems { get; set; }

Property Value

bool

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

cs-api-definition
public ICommand CancelCommand { get; }

Property Value

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

cs-api-definition
public ICommand CommitCommand { get; }

Property Value

ICommand

CommitMode

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

Declaration

cs-api-definition
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

cs-api-definition
public DataFormErrorDisplayOptions? ErrorDisplayOptions { get; set; }

Property Value

DataFormErrorDisplayOptions?

ErrorImageSource

Gets or sets the ImageSource of the error icons.

Declaration

cs-api-definition
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

cs-api-definition
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

cs-api-definition
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

cs-api-definition
[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

cs-api-definition
public DataFormErrorPosition? ErrorPosition { get; set; }

Property Value

DataFormErrorPosition?

HasPendingChanges

Gets a value indicating whether there are pending changes.

Declaration

cs-api-definition
public bool HasPendingChanges { get; }

Property Value

bool

HasValidationErrors

Gets a value indicating whether there are validation errors.

Declaration

cs-api-definition
public bool HasValidationErrors { get; }

Property Value

bool

HeaderDisplayOptions

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

Declaration

cs-api-definition
public DataFormHeaderDisplayOptions? HeaderDisplayOptions { get; set; }

Property Value

DataFormHeaderDisplayOptions?

HeaderImageSource

Gets or sets the ImageSource of the header icons.

Declaration

cs-api-definition
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

cs-api-definition
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

cs-api-definition
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

cs-api-definition
[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

cs-api-definition
public DataFormHeaderPosition? HeaderPosition { get; set; }

Property Value

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

cs-api-definition
public bool IsValidationSummaryVisible { get; set; }

Property Value

bool

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:

Declaration

cs-api-definition
public IList<DataFormItem> Items { get; }

Property Value

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

cs-api-definition
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

cs-api-definition
public ICommand ValidateCommand { get; }

Property Value

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

cs-api-definition
public IReadOnlyList<DataFormValidationError> ValidationErrors { get; }

Property Value

IReadOnlyList<DataFormValidationError>

ValidationMode

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

Declaration

cs-api-definition
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

cs-api-definition
public IList<DataFormObjectValidationRule> ValidationRules { get; }

Property Value

IList<DataFormObjectValidationRule>

ValidationSummaryImageSource

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

Declaration

cs-api-definition
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

cs-api-definition
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

cs-api-definition
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

cs-api-definition
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

cs-api-definition
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

cs-api-definition
public void CancelChanges(string propertyName)

Parameters

propertyName

string

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

cs-api-definition
public bool CommitChanges()

Returns

bool

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

cs-api-definition
public bool CommitChanges(string propertyName)

Parameters

propertyName

string

Specifies the name of the property to commit.

Returns

bool

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

OnBindingContextChanged()

Called when the binding context changes.

Declaration

cs-api-definition
protected override void OnBindingContextChanged()

Overrides RadContentView.OnBindingContextChanged()

OnHandlerChanged()

Called when the handler changes.

Declaration

cs-api-definition
protected override void OnHandlerChanged()

Overrides RadContentView.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

cs-api-definition
public bool ValidateChanges()

Returns

bool

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

cs-api-definition
public bool ValidateChanges(string propertyName)

Parameters

propertyName

string

Specifies the name of the property to validate.

Returns

bool

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

cs-api-definition
public event EventHandler<DataFormEditorGeneratedEventArgs> EditorGenerated

Event Value

EventHandler<DataFormEditorGeneratedEventArgs>

EditorValidationCompleted

Raised when the validation of an editor has completed.

Declaration

cs-api-definition
public event EventHandler<DataFormEditorValidationCompletedEventArgs> EditorValidationCompleted

Event Value

EventHandler<DataFormEditorValidationCompletedEventArgs>

EditorValueChanged

Raised when the value of an editor has changed.

Declaration

cs-api-definition
public event EventHandler<DataFormEditorValueChangedEventArgs> EditorValueChanged

Event Value

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

cs-api-definition
public event EventHandler<DataFormGroupGeneratedEventArgs> GroupGenerated

Event Value

EventHandler<DataFormGroupGeneratedEventArgs>

ValidationCompleted

Raised when the validation of the data form has completed.

Declaration

cs-api-definition
public event EventHandler<DataFormObjectValidationCompletedEventArgs> ValidationCompleted

Event Value

EventHandler<DataFormObjectValidationCompletedEventArgs>

In this article
DefinitionConstructorsRadDataForm()FieldsActualValidationSummaryImageStylePropertyActualValidationSummaryLabelStylePropertyActualValidationSummaryStylePropertyAutoGenerateItemsPropertyCommitModePropertyErrorDisplayOptionsPropertyErrorImageSourcePropertyErrorImageStylePropertyErrorLabelStylePropertyErrorLengthPropertyErrorPositionPropertyHasPendingChangesPropertyHasValidationErrorsPropertyHeaderDisplayOptionsPropertyHeaderImageSourcePropertyHeaderImageStylePropertyHeaderLabelStylePropertyHeaderLengthPropertyHeaderPositionPropertyIsValidationSummaryVisiblePropertyLayoutDefinitionPropertyValidationModePropertyValidationSummaryImageSourcePropertyValidationSummaryImageStylePropertyValidationSummaryLabelStylePropertyValidationSummaryStylePropertyPropertiesActualValidationSummaryImageStyleActualValidationSummaryLabelStyleActualValidationSummaryStyleAutoGenerateItemsCancelCommandCommitCommandCommitModeErrorDisplayOptionsErrorImageSourceErrorImageStyleErrorLabelStyleErrorLengthErrorPositionHasPendingChangesHasValidationErrorsHeaderDisplayOptionsHeaderImageSourceHeaderImageStyleHeaderLabelStyleHeaderLengthHeaderPositionIsValidationSummaryVisibleItemsLayoutDefinitionValidateCommandValidationErrorsValidationModeValidationRulesValidationSummaryImageSourceValidationSummaryImageStyleValidationSummaryLabelStyleValidationSummaryStyleMethodsCancelChanges()CancelChanges(string)CommitChanges()CommitChanges(string)OnBindingContextChanged()OnHandlerChanged()ValidateChanges()ValidateChanges(string)EventsEditorGeneratedEditorValidationCompletedEditorValueChangedGroupGeneratedValidationCompleted
Not finding the help you need?
Contact Support