.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:
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 theValidationMode
from the DataForm. -
CommitMode
(Telerik.Maui.Controls.DataFormCommitMode
)—Inherits theCommitMode
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 theTelerik.Maui.Controls.DataFormEditor.ErrorPosition
property is set toBeside
. -
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 theTelerik.Maui.Controls.RadDataForm.AutoGenerateItems
property istrue
and there isn't editor specified explicitly for the given property in theTelerik.Maui.Controls.RadDataForm.Items
collection. You can customize, replace, or discard the generated editor before adding it to the data form. TheEditorGenerated
event handler receives two parameters:-
sender
argument which is of type object, but can be cast to theRadDataForm
type. -
DataFormEditorGeneratedEventArgs
which has a reference to thePropertyName
(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) andEditor
(Specifies the editor which is generated for the specified property. To skip the generation of the editor, set the property tonull
)
-
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. TheEditorValueChanged
event handler receives two parameters:-
sender
argument which is of type object, but can be cast to theRadDataForm
type. -
DataFormEditorValueChangedEventArgs
which has a reference to thePropertyName
,EditorValue
andPropertyValue
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.