We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add custom text editor in Xamarin.Forms DataForm and customize the default appearance in platform renderer?

Platform: Xamarin.Forms |
Control: SfDataForm |
Published Date: November 14, 2018 |
Last Revised Date: November 14, 2018

 

DataForm allows you to add custom editor by overriding the DataFormEditor class which is used to add custom view.

 

This article explains adding custom text editor in DataForm.

 

 

By passing custom view in DataFormEditor class, you can add the custom editor in data form. You can refer to the DataForm user guide documentation for creating new custom editor:

https://help.syncfusion.com/xamarin/sfdataform/editing#creating-new-custom-editor

 

Here, Entry is loaded for custom entry editor.

 

 

The custom view (Entry) property settings, commit, and data validation can be handled by overriding required methods in the DataFormEditor class

 

Manually commit the custom data form item editor value by using the OnCommitValue override method of the DataFormEditor class on the custom editor TextChanged event which is used to update custom editor value in the DataObject property of DataForm.

Manually validate the custom editor value by using the OnValidateValue override method of the DataFormEditor class on the custom editor Unfocused event which is used to validate custom editor value in DataForm.

 

 

Refer to the following code example for binding the DataObject and adding custom editor as TextBoxEditor editor using the RegisterEditor method in DataForm.

 

 

You can also customize or change the default appearance of loaded custom editor view in custom renderer platform using the OnElementChanged override method of EntryRenderer.

 

This article explains pointer over customization for text editor by overriding the default style of TextBox and custom renderer in DataForm for Xamarin.Forms.UWP platform alone.

 

Here, TextBox is loaded as native control for custom entry editor in Xamarin.Forms.UWP platform. By overriding the default style of TextBox, the control can customize the pointer over text color and border color for text editor. 

 

 

By using the GotFocus, LostFocus, PointerEntered, and PointerExited events of the TextBox control, customized the PlaceholderText and border color on pointer over.

 

To download the sample click DataFormCustomTextEditor.

 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile