.NET MAUI DataForm Editors

The Telerik DataForm control supports built-in editors.

The table below describes the available editors which use the Telerik .NET MAUI controls:

Telerik Maui Ninja image

The Editors is part of Telerik UI for .NET MAUI, the most comprehensive UI suite for .NET MAUI! To try it out, sign up for a free 30-day trial and kickstart your cross-platform app development today.

Editor name Type Input control
DataFormRadEntryEditor (default) string Telerik .NET MAUI RadEntry
DataFormRadEntryPasswordEditor string Telerik .NET MAUI RadEntry
DataFormRadTextMaskedEditor string Telerik .NET MAUI RadTextMaskedEntry
DataFormRadNumericMaskedEditor object Telerik .NET MAUI RadNumericMaskedEntry
DataFormRadEmailMaskedEditor string Telerik .NET MAUI RadEmailMaskedEntry
DataFormRadRegexMaskedEditor string Telerik .NET MAUI RadRegexMaskedEntry
DataFormRadNumericEditor (default) double? Telerik .NET MAUI RadNumericInput
DataFormRadDatePickerEditor DateTime? Telerik .NET MAUI RadDatePicker
DataFormRadDateTimePickerEditor DateTime? Telerik .NET MAUI RadDateTimePicker
DataFormRadTimePickerEditor TimeSpan? Telerik .NET MAUI RadTimePicker
DataFormRadTimeSpanPickerEditor TimeSpan? Telerik .NET MAUI RadTimeSpanPicker
DataFormRadListPickerEditor enum Telerik .NET MAUI RadListPicker
DataFormRadComboBoxEditor (default on desktop) enum Telerik .NET MAUI RadComboBox
DataFormRadCheckBoxEditor (default) bool? Telerik .NET MAUI RadCheckBox
DataFormRadSegmentedEditor (default on mobile) enum Telerik .NET MAUI RadSegmentedControl

The table below describes the available editors which use the .NET MAUI controls:

Editor name Type Input control
DataFormMultiLineEditor string .NET MAUI Editor
DataFormDatePickerEditor (default) DateTime? .NET MAUI DatePicker
DataFormTimePickerEditor (default) TimeSpan? .NET MAUI TimePicker
DataFormSwitchEditor bool .NET MAUI Switch

The default editor is represented when the DataForm generates the editors automatically.

Common Properties for Built-In Editors

  • Placeholder(string)—Specifies the placeholder value to display, when the user hasn't provided a value yet.
  • PropertyName(string)—Specifies the name of the property from the business object this editor is bound to.
  • PropertyValue(object)—Defines the value of the property from the business object this editor is bound to.
  • EditorValue(object)—Specifies the current edited value, before applying it to the business object.
  • IsReadOnly(bool?)—Specifies whether the current editor is in a read-only mode.
  • ValidationMode(Telerik.Maui.Controls.DataFormValidationMode)—Inherits the ValidationMode from the DataForm.
  • CommitMode(Telerik.Maui.Controls.DataFormCommitMode)—Inherits the CommitMode from the DataForm.
  • ColumnSpacing(double)—Specifies the horizontal spacing between the rows in the editor.
  • RowSpacing(double)—Specifies the vertical spacing between the rows in the editor.
  • ErrorDisplayOptions(Telerik.Maui.Controls.DataFormErrorDisplayOptions?)—Specifies the display options of the header.
  • ErrorLength(Microsoft.Maui.GridLength)—Specifies the length of the error in the editor. This property has an effect only when the Telerik.Maui.Controls.DataFormEditor.ErrorPosition property is set to Beside.
  • ErrorPosition(Telerik.Maui.Controls.DataFormErrorPosition?)—Specifies the error position in the editor.
  • ErrorImageSource(Telerik.Maui.Controls.ImageSource)—Specifies the image source of the error icon.

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 of the editors when the Telerik.Maui.Controls.RadDataForm.AutoGenerateItems property is true and there isn't editor specified explicitly for the given property in the Telerik.Maui.Controls.RadDataForm.Items collection. You can customize, replace, or discard the generated editor before adding it to the data form. The EditorGenerated event handler receives two parameters:
    • sender argument which is of type object, but can be cast to the RadDataForm type.
    • DataFormEditorGeneratedEventArgs which has a reference to the PropertyName(Gets the name of property from the data model, for which to generate an editor), PropertyType(Gets the type of property from the data model, for which to generate an editor) and Editor(Specifies the editor which is generated for the specified property. To skip the generation of the editor, set the property to null)
this.dataForm.EditorGenerated += this.OnEditorGenerated;

And the handler:

private void OnEditorGenerated(object sender, DataFormEditorGeneratedEventArgs eventArgs)
{
    switch (eventArgs.PropertyName)
    {
        case "FirstName":
            eventArgs.Editor.HeaderText = "First Name";
            break;
        case "LastName":
            eventArgs.Editor.HeaderText = "Last Name";
            break;
        case "StartDate":
            eventArgs.Editor = new DataFormRadDatePickerEditor
            {
                PropertyName = "StartDate",
                HeaderText = "Start Date"
            };
            break;
        case "EndDate":
            eventArgs.Editor = new DataFormRadTimePickerEditor
            {
                PropertyName = "EndDate",
                HeaderText = "Time",
            };
            break;
        case "Accommodation":
            eventArgs.Editor = new DataFormRadComboBoxEditor
            {
                PropertyName = "Accommodation",
                HeaderText = "Accommodation",
            };
            break;
    }
}

For a runnable example with the DataForm CustomGenerate scenario, see the SDKBrowser Demo Application and go to DataForm > Getting Started category.

  • EditorValueChanged—Raised when the value of an editor has changed. The EditorValueChanged event handler receives two parameters:
    • sender argument which is of type object, but can be cast to the RadDataForm type.
    • DataFormEditorValueChangedEventArgs which has a reference to the PropertyName, EditorValue and PropertyValue of the concrete editor.

Custom Editors

You can define a custom editor using the DataFormCustomEditor. This editor inherits from DataFormEditor. More information on this can be found in Custom Editors article.

See Also

In this article