Hide spin buttons on SfNumericUpDown

Hi,

I'm trying to hide spin buttons on SfNumericUpDown control. Is it possible? I tried to use style similar way as described here for SFDomainUpDown but with no success.

Could someone please help?

Thanks,
Peter

2 Replies

PV Peter Verbo November 4, 2017 09:37 AM UTC

Finally I have something. But still if somebody see some issues with this solution please let me know:

    xmlns:syncfusion="using:Syncfusion.UI.Xaml.Controls.Input"
    xmlns:sync="using:Syncfusion.UI.Xaml.Controls"

        <sfInput:SfNumericUpDown UpDownStyle="{StaticResource NoSpinButtonsStyle}"/>

        <Style x:Key="NoSpinButtonsStyle" TargetType="sync:SfUpDown">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="sync:SfUpDown">
                        <Grid x:Name="PART_OuterGrid">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <ContentControl x:Name="PART_Content"
                                            Content="{TemplateBinding UpDownContent}"
                                            Margin="1"
                                            HorizontalContentAlignment="Stretch"
                                            VerticalContentAlignment="Stretch"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>




VJ Victory Jessie Selvam D Syncfusion Team November 6, 2017 04:52 AM UTC

Hi Peter,

Thank you for using Syncfusion products.

Spin buttons in SfNumericUpDown control can be hidden by removing the repeat buttons from control template using UpDownStyle property. But the code you have suggested hides the spin buttons along with the control border. Alternatively we can traverse the SfNumericUpDown control's visual tree to retrieve the repeat buttons instances and collapse it. We have prepared a sample with these two solutions and you can download it from the following link:

Sample: Spin_Buttons_Hidden

Regards,
Jessie

Loader.
Up arrow icon