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:
- Create a custom SfNumericUpDown by inheriting the SfNumericUpDown class.
- 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: