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

4 posts, 1 answers
  1. Takashi Nimura
    Takashi Nimura avatar
    4 posts
    Member since:
    Jul 2012

    Posted 11 Sep 2011 Link to this post

    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();
            }
        }
    }
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 15 Sep 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 15 Sep 2011 Link to this post

    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 >>

  5. Takashi Nimura
    Takashi Nimura avatar
    4 posts
    Member since:
    Jul 2012

    Posted 20 Sep 2011 Link to this post

    Hi,
    Thanks for your response and advice.
Back to Top