Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Slider > RadSlider SelectionEnd goes beyond Maximum

Not answered RadSlider SelectionEnd goes beyond Maximum

Feed from this thread
  • Josh avatar

    Posted on Oct 14, 2011 (permalink)

    Hi,

    I expect the SelectionEnd and SelectionStart values to stay within the bounds of the Maximum and Minimum but they don't.  I created a small sample app that demonstrates this behavior.

    View:
    <Grid>
        <StackPanel>        
            <StackPanel Orientation="Horizontal" Height="50">
                <Label Content="Upper Thumb" />
                <TextBox Width="300" Height="35" Text="{Binding Path=SelectionEnd}" />
            </StackPanel>
            <telerik:RadSlider Name="radSlider"
                               VerticalAlignment="top"
                               Width="25"
                               Height="200"
                               Margin="0 10 5 0"
                               IsSelectionRangeEnabled="True"
                               TickPlacement="None"
                               Minimum="0.0"
                               Maximum="1.0"
                               Orientation="Vertical"
                               SelectionStart="{Binding Path=SelectionStart, Mode=TwoWay, FallbackValue=0.25}"
                               SelectionEnd="{Binding Path=SelectionEnd, Mode=TwoWay, FallbackValue=0.5}"
                               LargeChange="0.05"
                               SmallChange="0.05" />
            <StackPanel Orientation="Horizontal" Height="50">
                <Label Content="Lower Thumb" />
                <TextBox Width="300"  Height="35" Text="{Binding Path=SelectionStart}" />
            </StackPanel>
        </StackPanel>
    </Grid>

    Code behind:
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            var vm = new SliderViewModel();
            DataContext = vm;
        }
    }

    ViewModel:
    public class SliderViewModel : INotifyPropertyChanged
    {
        public SliderViewModel()
        {
            _selectionStart = 0.25;
            _selectionEnd = 0.5;
        }
        private double _selectionStart;
        public double SelectionStart
        {
            get
            {
                return _selectionStart;
            }
            set
            {
                if (_selectionStart != value)
                {
                    _selectionStart = value;
                    OnPropertyChanged("SelectionStart");
                }
            }
        }
        private double _selectionEnd;
        public double SelectionEnd
        {
            get
            {
                return _selectionEnd;
            }
            set
            {
                if (_selectionEnd != value)
                {
                    _selectionEnd = value;
                    OnPropertyChanged("SelectionEnd");
                }
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged(String propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    Am I missing a property on the slider that will prevent this behavior or do I have to catch it manually?

    Thanks,
    Josh

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Oct 19, 2011 (permalink)

    Hi Josh,

     We are aware of this issue and we have previously logged it in our PITS. The good news is that you can use the Selection property of the RadSlider which is of type SelectionRange<double>. You can find this realized in the attached solution. Please let us know if this is suitable for you.

    Greetings,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Attached files

    Reply

  • Josh avatar

    Posted on Oct 24, 2011 (permalink)

    Hi Petar,

    I don't see this issue in PITS, can you point me to the issue ID please?  I'll check out your sample application and let you know if it's going to work.

    Thanks,
    Josh

    Reply

  • Josh avatar

    Posted on Oct 24, 2011 (permalink)

    Hi Petar,

    Thank you for the sample app.  I'm not going to implement this change in our application because we're already handling the bug with another workaround and your workaround doesn't buy us anything different.  But I do appreciate your help and it's nice to know that we have options.  I would like to know if there's a way for me to track the bug.

    Thanks,
    Josh

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Oct 27, 2011 (permalink)

    Hello Josh,

     Please excuse us, the link was broken. Here is the fixed link to the PITS item.

    Best wishes,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Slider > RadSlider SelectionEnd goes beyond Maximum
Related resources for "RadSlider SelectionEnd goes beyond Maximum"

WPF Slider Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]