Disable keyboard on specific data fields

Is there a way on a dataform to disable pop up keyboard on certain fields ? We have fields where we are using a keybaord wedge to scan barcode and populate the field and we don't want the keyboard available on that field


1 Reply

SS SaiGanesh Sakthivel Syncfusion Team November 17, 2021 10:41 AM UTC

Hi Clark, 
 
Thank you for using Syncfusion products. 
 
#Regarding Disable keyboard on specific data fields 
We have checked the reported query from our end. Your requirement can be achieved with help of custom DataFormTextEditor. Inside the CustomDataFormTextEditor, you can disable the keyboard by setting ShowSoftInputOnFocus property as False. Please refer to the following code snippet for your reference. 
 
Code snippet 
  dataForm.RegisterEditor("Text", new DataFormTextEditorExt(dataForm));
..
..
public
class DataFormTextEditorExt : DataFormTextEditor 
{ 
    public DataFormTextEditorExt(SfDataForm dataForm) : base(dataForm) 
    { 
 
    } 
 
    protected override void OnInitializeView(DataFormItem dataFormItem, EditText view) 
    { 
        view.ShowSoftInputOnFocus = false; 
        base.OnInitializeView(dataFormItem, view); 
    } 
} 
 
Please refer to the tested sample in the following locations,
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataFormAndroid-2007611612
 
 
Please let us know if you have any concerns. 
 
Regards,
SaiGanesh Sakthivel
 


Loader.
Up arrow icon