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:
public class RadDataForm : DataFormContentView, IRadContentView, IContentView, IPadding, ICrossPlatformLayout, IView, IElement, ITransform, ISmartPasteButtonProvider
Inheritance: objectRadContentViewDataFormContentViewRadDataForm
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadDataForm class.
public RadDataForm()
Fields
ActualValidationSummaryImageStyleProperty
BindableProperty
Identifies the ActualValidationSummaryImageStyle property.
public static readonly BindableProperty ActualValidationSummaryImageStyleProperty
ActualValidationSummaryLabelStyleProperty
BindableProperty
Identifies the ActualValidationSummaryLabelStyle property.
public static readonly BindableProperty ActualValidationSummaryLabelStyleProperty
ActualValidationSummaryStyleProperty
BindableProperty
Identifies the ActualValidationSummaryStyle property.
public static readonly BindableProperty ActualValidationSummaryStyleProperty
AutoGenerateItemsProperty
BindableProperty
Identifies the AutoGenerateItems property.
public static BindableProperty AutoGenerateItemsProperty
CommitModeProperty
BindableProperty
Identifies the CommitMode property.
public static readonly BindableProperty CommitModeProperty
ErrorDisplayOptionsProperty
BindableProperty
Identifies the ErrorDisplayOptions property.
public static readonly BindableProperty ErrorDisplayOptionsProperty
ErrorImageSourceProperty
BindableProperty
Identifies the ErrorImageSource property.
public static readonly BindableProperty ErrorImageSourceProperty
ErrorImageStyleProperty
BindableProperty
Identifies the ErrorImageStyle property.
public static readonly BindableProperty ErrorImageStyleProperty
ErrorLabelStyleProperty
BindableProperty
Identifies the ErrorLabelStyle property.
public static readonly BindableProperty ErrorLabelStyleProperty
ErrorLengthProperty
BindableProperty
Identifies the ErrorLength property.
public static readonly BindableProperty ErrorLengthProperty
ErrorPositionProperty
BindableProperty
Identifies the ErrorPosition property.
public static readonly BindableProperty ErrorPositionProperty
HasPendingChangesProperty
BindableProperty
Identifies the HasPendingChanges property.
public static readonly BindableProperty HasPendingChangesProperty
HasValidationErrorsProperty
BindableProperty
Identifies the HasValidationErrors property.
public static readonly BindableProperty HasValidationErrorsProperty
HeaderDisplayOptionsProperty
BindableProperty
Identifies the HeaderDisplayOptions property.
public static readonly BindableProperty HeaderDisplayOptionsProperty
HeaderImageSourceProperty
BindableProperty
Identifies the HeaderImageSource property.
public static readonly BindableProperty HeaderImageSourceProperty
HeaderImageStyleProperty
BindableProperty
Identifies the HeaderImageStyle property.
public static readonly BindableProperty HeaderImageStyleProperty
HeaderLabelStyleProperty
BindableProperty
Identifies the HeaderLabelStyle property.
public static readonly BindableProperty HeaderLabelStyleProperty
HeaderLengthProperty
BindableProperty
Identifies the HeaderLength property.
public static readonly BindableProperty HeaderLengthProperty
HeaderPositionProperty
BindableProperty
Identifies the HeaderPosition property.
public static readonly BindableProperty HeaderPositionProperty
IsValidationSummaryVisibleProperty
BindableProperty
Identifies the IsValidationSummaryVisible property.
public static readonly BindableProperty IsValidationSummaryVisibleProperty
LayoutDefinitionProperty
BindableProperty
Identifies the LayoutDefinition property.
public static readonly BindableProperty LayoutDefinitionProperty
ValidationModeProperty
BindableProperty
Identifies the ValidationMode property.
public static readonly BindableProperty ValidationModeProperty
ValidationSummaryImageSourceProperty
BindableProperty
Identifies the ValidationSummaryImageSource property.
public static readonly BindableProperty ValidationSummaryImageSourceProperty
ValidationSummaryImageStyleProperty
BindableProperty
Identifies the ValidationSummaryImageStyle property.
public static readonly BindableProperty ValidationSummaryImageStyleProperty
ValidationSummaryLabelStyleProperty
BindableProperty
Identifies the ValidationSummaryLabelStyle property.
public static readonly BindableProperty ValidationSummaryLabelStyleProperty
ValidationSummaryStyleProperty
BindableProperty
Identifies the ValidationSummaryStyle property.
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.
public Style ActualValidationSummaryImageStyle { get; }
Gets the result from merging the Style specified in the ValidationSummaryLabelStyle property and the default base Style for that property.
public Style ActualValidationSummaryLabelStyle { get; }
Gets the result from merging the Style specified in the ValidationSummaryStyle property and the default base Style for that property.
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.
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.
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.
public ICommand CommitCommand { get; }
Gets or sets the current commit mode of the RadDataForm. For more information see the DataFormCommitMode type.
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.
public DataFormErrorDisplayOptions? ErrorDisplayOptions { get; set; }
ErrorImageSource
ImageSource
Gets or sets the ImageSource of the error icons.
public ImageSource ErrorImageSource { get; set; }
ErrorImageStyle
Style
Gets or sets the Style applied to the error icons. The target type of this Style is .
public Style ErrorImageStyle { get; set; }
ErrorLabelStyle
Style
Gets or sets the Style applied to the error labels. The target type of this Style is .
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.
[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.
public DataFormErrorPosition? ErrorPosition { get; set; }
Gets a value indicating whether there are pending changes.
public bool HasPendingChanges { get; }
Gets a value indicating whether there are validation errors.
public bool HasValidationErrors { get; }
Gets or sets the display options of the headers in the editors. For more information see the DataFormHeaderDisplayOptions type.
public DataFormHeaderDisplayOptions? HeaderDisplayOptions { get; set; }
HeaderImageSource
ImageSource
Gets or sets the ImageSource of the header icons.
public ImageSource HeaderImageSource { get; set; }
HeaderImageStyle
Style
Gets or sets the Style applied to the header icons. The target type of this Style is .
public Style HeaderImageStyle { get; set; }
HeaderLabelStyle
Style
Gets or sets the Style applied to the header labels. The target type of this Style is .
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.
[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.
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.
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.
public IList<DataFormItem> Items { get; }
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
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.
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.
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.
public IReadOnlyList<DataFormValidationError> ValidationErrors { get; }
Gets or sets the current validation mode of the RadDataForm. For more information see the DataFormValidationMode type.
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.
public IList<DataFormObjectValidationRule> ValidationRules { get; }
ValidationSummaryImageSource
ImageSource
Gets or sets the ImageSource of the image displayed in the validation summary.
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 .
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 .
public Style ValidationSummaryLabelStyle { get; set; }
Gets or sets the Style applied to the validation summary. The target type of this Style is DataFormValidationSummaryView.
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.
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.
public void CancelChanges(string propertyName)
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.
public bool CommitChanges()
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.
Called when the binding context changes.
protected override void OnBindingContextChanged()
Overrides:
Called when the handler changes.
protected override void OnHandlerChanged()
Overrides:
Executes the validation logic associated with the current RadDataForm. This method is mostly useful when the ValidationMode property is set to Explicit.
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
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.
public event EventHandler<DataFormEditorGeneratedEventArgs> EditorGenerated
Raised when the validation of an editor has completed.
public event EventHandler<DataFormEditorValidationCompletedEventArgs> EditorValidationCompleted
Raised when the value of an editor has changed.
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.
public event EventHandler<DataFormGroupGeneratedEventArgs> GroupGenerated
Raised when the validation of the data form has completed.
public event EventHandler<DataFormObjectValidationCompletedEventArgs> ValidationCompleted