Articles in this section
Category / Section

How to resolve the issue with decimal point and minus key on Samsung devices in SfNumericTextBox

1 min read

When using virtual numeric keyboard in SfNumericTextBox, decimal point and minus sign will be missing in some of the Samsung devices.

To resolve this issue, follow the below steps:

  1. Create a custom SfNumericTextBox by inheriting the SfNumericTextBox class.
  2. Similarly, create a CustomNumericTextBoxRenderer class by inheriting SfNumericTextBoxRenderer.

 

Code for custom renderer in Android:

[assembly: ExportRenderer(typeof(CustomNumeric), typeof(CustomNumericTextBoxRenderer))]
namespace Samsung_issue.Droid
{
 public class CustomNumericTextBoxRenderer : SfNumericTextBoxRenderer
 {
  protected override void OnElementChanged(ElementChangedEventArgs<SfNumericTextBox> e)
  {
   base.OnElementChanged(e);
 
   if (Control != null)
   {
    EditText control = this.Control as EditText;
    if (control != null)
    {
     control.InputType = Android.Text.InputTypes.ClassPhone;
    }
   }
  }
 }
}

 

Output:

Image represent the decimal point and minus key missing issue on Samsung devices in SfNumericTextBox.

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied