This is a migrated thread and some comments may be shown as answers.

Behavior when "Thumb" is dragged over the "Track".

3 Answers 101 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Takashi Nimura
Top achievements
Rank 1
Takashi Nimura asked on 12 Sep 2011, 02:27 AM
Hi

[reproduce and phenomenon]
Bind the RadSlider's SelectionStart/SelectionEnd to Application's DependencyProperty.
When Slider's Thumb is dragged out of the control, values which exceed Minimum/Maximum
Property are substituted into the Property.

This problem did not occur in the Q1 2011.
 
If there is any way to avoid the above phenomenon, please let me know.

  • RadControl for WPF (Version: 2011.2.712.40)
  • OS:Windows7 Ultimate 64 bit
  • VisualStudio 2010 SP1

[VS Project]
RadSliderTest Project

[XAML]
<Window
    x:Class="RadSliderTest.MainWindow"
    Title="RadSlider TEST" Width="640" Height="320"
    Background="#FF393838" TextBlock.Foreground="White" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="48"/>
            <RowDefinition Height="Auto" MinHeight="32"/>
            <RowDefinition Height="Auto" MinHeight="48"/>
            <RowDefinition Height="Auto" MinHeight="32"/>
            <RowDefinition Height="Auto" MinHeight="48"/>
            <RowDefinition Height="Auto" MinHeight="32"/>
        </Grid.RowDefinitions>
         
        <TextBlock Margin="8,8,8,2" Text="RadSlider(SelectionRangeEnable, Minimun:0.0, Maximum1.0) " VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"/>
        <telerik:RadSlider x:Name="radSlider" Margin="8" VerticalAlignment="Center"
            SelectionStart="{Binding RangeBegin, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
            SelectionEnd="{Binding RangeEnd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
            IsSelectionRangeEnabled="True" Grid.Row="1"/>
 
        <TextBlock Margin="8,8,8,2" Grid.Row="2" Text="MainWindow DependencyProperty Binding" VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"/>
        <Grid Margin="8" Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
 
            <TextBlock Margin="8" Text="RangeBegin" VerticalAlignment="Center" HorizontalAlignment="Right"/>
            <TextBlock Margin="8" Grid.Row="1" TextWrapping="Wrap"
                Text="{Binding RangeBegin, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
                VerticalAlignment="Center" Grid.Column="1" Foreground="Black" Background="White" />
            <TextBlock Margin="8" Text="RangeEnd" VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right" />
            <TextBlock Margin="8" Grid.Row="1" TextWrapping="Wrap"
                Text="{Binding RangeEnd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
                VerticalAlignment="Center" Grid.Column="3" Foreground="Black" Background="White" />
        </Grid>
 
        <TextBlock Margin="8,8,8,2" Grid.Row="4" Text="ControlBinding" VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"/>
        <Grid Margin="8" Grid.Row="5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Margin="8" Text="SelectionStart" VerticalAlignment="Center" HorizontalAlignment="Right"/>
            <TextBlock Margin="8"
                Text="{Binding SelectionStart, ElementName=radSlider}"
                VerticalAlignment="Center" Grid.Column="1" Background="White" Foreground="Black" />
            <TextBlock Margin="8" Text="SelectionEnd" VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right"/>
            <TextBlock Margin="8"
                Text="{Binding SelectionEnd, ElementName=radSlider}"
                VerticalAlignment="Center" Grid.Column="3" Background="White" Foreground="Black" />
        </Grid>
    </Grid>
</Window>

[CS]
using System.Windows;
 
namespace RadSliderTest
{
    public partial class MainWindow : Window
    {
        #region [RangeBegin] DependencyProperty
        public double RangeBegin
        {
            get { return (double)GetValue(RangeBeginProperty); }
            set { SetValue(RangeBeginProperty, value); }
        }
        public static readonly DependencyProperty RangeBeginProperty =
            DependencyProperty.Register("RangeBegin", typeof(double), typeof(MainWindow), new PropertyMetadata(0.0));
        #endregion
 
        #region [RangeEnd] DependencyProperty
        public double RangeEnd
        {
            get { return (double)GetValue(RangeEndProperty); }
            set { SetValue(RangeEndProperty, value); }
        }
        public static readonly DependencyProperty RangeEndProperty =
            DependencyProperty.Register("RangeEnd", typeof(double), typeof(MainWindow), new PropertyMetadata(1.0));
        #endregion
 
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 15 Sep 2011, 07:45 AM
Hello Takashi Nimura,

 Please first excuse us for the delayed response. This appears to be a bug in the RadSlider from Q2 2011.
We logged it in our PITS(Slider:Binding the SelectionStart / SelectionEnd does not work correctly) where you are now able to track its status. We also updated your telerik account points. Thank you for your cooperation.

Kind regards,
Petar Mladenov
the Telerik team

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

0
Accepted
Petar Mladenov
Telerik team
answered on 15 Sep 2011, 11:31 AM
Hello Takashi Nimura,

 We also wanted to let you know that there is a workaround using the Q2 2011 version. It uses the Selection property instead of the SelectionStart and SelectionEnd. Please check out the attached solution where this is realized.

All the best,
Petar Mladenov
the Telerik team

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

0
Takashi Nimura
Top achievements
Rank 1
answered on 20 Sep 2011, 04:51 PM
Hi,
Thanks for your response and advice.
Tags
Slider
Asked by
Takashi Nimura
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Takashi Nimura
Top achievements
Rank 1
Share this question
or