.NET MAUI DataForm Custom Editors
DataForm has a support for custom editors with 5.1.0 version of Telerik UI for .NET MAUI.
-
DataFormCustomEditor
—Represents a custom editor in theRadDataForm
.
Properties
-
EditorTemplate
(ControlTemplate
)—Defines the content of the custom editor. The target type of this template isTelerik.Maui.Controls.DataFormCustomEditorContentPresenter
. TheDataFormCustomEditorContentPresenter
exposes the following properties:-
Value
(object
)—Specifies the value of the editor. -
Editor
(Telerik.Maui.Conrols.DataFormCustomEditor
)—Gets the editor this control is associated with.
-
Placeholder
(string
)—Specifies the placeholder value to display, when there hasn't been 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
)—Defines the current validation mode of the DataForm editor. -
CommitMode
(Telerik.Maui.Controls.DataFormCommitMode
)—Specifies the current commit mode of the DataForm editor. -
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.
AutoComplete control as a Custom Editor
And the ViewModel
used for the RadDataForm
:
Note that local
in the snippet above points to the namespace where the CustomEditorViewModel
is defined.
Styling
You can style the custom editor area by setting the BackgroundColor
, BorderColor
and BorderThickness
properties.
Inherited Editor
You can create an inherited editor that inherits from DataFormCustomEditor
.