Spin Button Alignment in WPF Domain Updown (SfDomainUpDown)

5 May 20212 minutes to read

The spin button’s position in the DomainUpDown control can be changed using SpinButtonsAlignment. It contains three modes for positioning spin buttons:

  1. Right
  2. Left
  3. Both

Spin buttons will be aligned on the right side of the control.

<editors:SfDomainUpDown x:Name="domainUpDown"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="200" 
                      SpinButtonsAlignment="Right"
                      ItemsSource="{Binding Employees}">
 </editors:SfDomainUpDown>

Spin-Button-Alignment_img1

Spin-Button-Alignment_img2

Left

Spin buttons will be aligned on the left side of the control.

<editors:SfDomainUpDown x:Name="domainUpDown"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="200" 
                      SpinButtonsAlignment="Left"
                      ItemsSource="{Binding Employees}">        </editors:SfDomainUpDown>

Spin-Button-Alignment_img3

Spin-Button-Alignment_img4

Both

The spin button’s decrement button will be aligned on the left side of the control and the increment button is aligned on the right side of the control.

<editors:SfDomainUpDown x:Name="domainUpDown"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="200" 
                      SpinButtonsAlignment="Both"
                      ItemsSource="{Binding Employees}">        
</editors:SfDomainUpDown>

Spin-Button-Alignment_img5