Orientation in WPF Range Slider (SfRangeSlider)
7 May 20213 minutes to read
The Orientation property has the following two options.
- Horizontal
- Vertical
The default option is Horizontal.
<editors:SfRangeSlider
Width="300"
Maximum="100"
Minimum="0"
Orientation="Horizontal"
Value="50" />
Grid parentGrid = new Grid();
SfRangeSlider rangeSlider = new SfRangeSlider()
{
Width = 300,
Maximum = 100,
Minimum = 0,
Value = 50,
Orientation = Orientation.Horizontal
};
parentGrid.Children.Add(rangeSlider);
this.Content = parentGrid;;
The following code sample illustrates how to set vertical orientation to SfRangeSlider.
<editors:SfRangeSlider
Height="300"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Maximum="100"
Minimum="0"
Orientation="Vertical"
Value="50" />
Grid parentGrid = new Grid();
SfRangeSlider rangeSlider = new SfRangeSlider()
{
Width = 300,
Maximum = 100,
Minimum = 0,
Value = 50,
Orientation = Orientation.Vertical
};
parentGrid.Children.Add(rangeSlider);
this.Content = parentGrid;;