Category / Section
How to set SpinButton Position for SfDomainUpDown?
1 min read
SpinButton’s position in the DomainUpDown control can be changed by SpinButtonsAlignment property. SpinButtons position can be changed as Both, Left, Right.
The same has been explained in the following code snippet:
XAML:
//Code Explains How to set SpinButton Position in SfDomainUpDown <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="SfDomainUpDown.MainWindow" Title="MainWindow" Height="350" Width="525"> <Grid> <syncfusion:SfDomainUpDown Name="DomainUpDown" Width="150" Height="40" ItemsSource="{Binding Employees}" SpinButtonsAlignment="Both"> <syncfusion:SfDomainUpDown.ContentTemplate> <DataTemplate> <TextBlock Text="{Binding Name}"> </TextBlock> </DataTemplate> </syncfusion:SfDomainUpDown.ContentTemplate> </syncfusion:SfDomainUpDown> </Grid> </Window>
C#:
//Code Explains How to set SpinButton Position in SfDomainUpDown namespace SfDomainUpDown { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); this.DataContext = new Emp(); } } public class Employee { public string Name { get; set; } } public class Emp : Employee { public List<Employee> Employees { get; set; } public Emp() { Employees = new List<Employee>(); Employees.Add(new Employee { Name = "Raj" }); Employees.Add(new Employee { Name = "Lucus" }); Employees.Add(new Employee { Name = "Martin" }); } } }
Output:
Both:
Left:
Right: