Articles in this section
Category / Section

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

1 min read

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

To resolve this issue, follow the below steps:

  1. Create a custom SfNumericUpDown by inheriting the SfNumericUpDown class.
  2. Likewise create a CustomNumericUpDownRenderer class by inheriting SfNumericUpDownRenderer.

 

Code of Custom Renderer in Android:

[assembly: ExportRenderer(typeof(CustomNumericUpDown), typeof(CustomNumericUpDownRenderer))]
namespace Samsung_issue.Droid
{
 public class CustomNumericUpDownRenderer : SfNumericUpDownRenderer
 {
  protected override void OnElementChanged(ElementChangedEventArgs<SfNumericUpDown> e)
  {
   base.OnElementChanged(e);
 
   if (Control != null)
   {
    for (int i = 0; i < Control.ChildCount; i++)
    {
     var child = Control.GetChildAt(i);
     if (child is EditText)
     {
      var control = child as EditText;
      control.InputType = InputTypes.ClassPhone;
     }
    }
 
   }
 
  }
 }
}
 

 

Output:

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

 

 

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