.NET MAUI DataForm Editors
The Telerik DataFrom 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 |
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 |
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 |
enum |
Telerik .NET MAUI RadComboBox |
DataFormRadCheckBoxEditor |
bool? |
Telerik .NET MAUI RadCheckBox |
DataFormRadSegmentedEditor |
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 |
DateTime? |
.NET MAUI DatePicker |
DataFormTimePickerEditor |
TimeSpan? |
.NET MAUI TimePicker |
DataFormSwitchEditor |
bool |
.NET MAUI Switch |
Common Properties for built-in editors
-
Placeholder
(string
)—Specifies the placeholder value to display, when there is no input in the editor. -
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 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 is set totrue
and there is no editor specified explicitly for the given property in theTelerik.Maui.Controls.RadDataForm.Items
collection. It is possible to customize, replace or discard the generated editor, before it is added 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 CustomGenerate example refer to the DataForm/GettingStarted Category of the SDKBrowser Demo Application.
-
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 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.