Remove Underline in Numeric Up Down

Hi,

How do I remove the underline in the SfNumericUpDown control?



1 Reply 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team August 10, 2020 11:20 AM UTC

Hi Mauro Da Silva,

Greetings from Syncfusion.

Currently, there is no direct approach to achieve your requirement “ Remove borderline in numeric up-down”, we have achieved by using its custom renderer with platform-specific. 

Sample link:  https://www.syncfusion.com/downloads/support/directtrac/general/ze/NumericSample-2067638312 


Code snippet:
PCL: 

[XAML] 
 
    <ContentPage.Content>  
        <StackLayout Padding="30">  
            <local:CustomNumericUpDown x:Name="sfNumericUpDown" HeightRequest="100"  Value="100" AllowNull="false" FormatString="n"/>  
        </StackLayout>  
    </ContentPage.Content>  
 
  
C#  
    public class CustomNumericUpDown : SfNumericUpDown  
    {  
    }  
 
  
 Android:  
  protected override void OnElementChanged(ElementChangedEventArgs<Syncfusion.SfNumericUpDown.XForms.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.Background = null;  
                    }  
                }  
            }  
        }  
 
 
iOS:   
        protected override void OnElementChanged(ElementChangedEventArgs<Syncfusion.SfNumericUpDown.XForms.SfNumericUpDown> e)  
        {  
            base.OnElementChanged(e);  
            if (this.Control != null)  
            {  
                this.Control.Layer.BorderWidth = 0f;  
            }  
        }  
    }  
 
 
UWP:  
        protected override void OnElementChanged(ElementChangedEventArgs<SfNumericUpDown> e)  
        {  
            base.OnElementChanged(e);  
            if (Control != null)  
            {  
                Control.BorderThickness = new Windows.UI.Xaml.Thickness(0);  
            }  
        }  
 
 
Regards,
Sridevi S.

 


Marked as answer
Loader.
Up arrow icon