This is a migrated thread and some comments may be shown as answers.

EditorType.Password

1 Answer 121 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Andreas Decke
Top achievements
Rank 1
Andreas Decke asked on 02 Oct 2018, 08:25 AM

Hello,

I'm just about to replace my settings page with the DataForm. Unfortunately, I can not find an EditorType for a password! In the online documentation I find only one tip for iOS - but I need a tip (code) for Xamarin Forms.

Thanks in advance
Andreas

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 03 Oct 2018, 02:51 PM
Hello Andreas,

Password editor is not exposed for the Xamarin.Forms DataForm. We've already logged this functionality as a feature request in our Ideas & Feedback portal - DataForm: Implement Password Editor. I suggest you follow the item in order to receive automatic notifications when some major updates are available.

Meanwhile you can achieve this functionality for android and iOS by creating custom DataForm renderer. I'm posting simple implementation of CustomDataFormRenderer that should give you the desired result:

iOS implementation:
public class CustomDataFormRenderer : DataFormRenderer
{
    protected override Type GetCustomEditorType(string propertyName, Type propertyType)
    {
        if (propertyName == "Password")
        {
            return typeof(TKDataFormPasswordEditor);
        }
 
        return base.GetCustomEditorType(propertyName, propertyType);
    }
}



Android implementation:
public class CustomDataFormRenderer : DataFormRenderer
{
    public CustomDataFormRenderer(Context context) : base(context)
    {
    }
 
    protected override EntityPropertyEditor GetCustomEditorForProperty(RadDataForm form, IEntityProperty nativeProperty, Telerik.XamarinForms.Input.DataForm.IEntityProperty property)
    {
        if (nativeProperty.Name() == "Password")
        {
            return new Com.Telerik.Widget.Dataform.Visualization.Editors.DataFormPasswordEditor(form, nativeProperty);
        }
 
        return base.GetCustomEditorForProperty(form, nativeProperty, property);
    }
}


I hope I've been helpful.

Regards,
Nikolay
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataForm
Asked by
Andreas Decke
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or