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

Binding SelectionStart does not work in Q2

4 Answers 75 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Trude
Top achievements
Rank 2
Trude asked on 19 Jul 2011, 08:58 AM

This XAML worked in Q1, but no longer works (SelectionEnd binds OK):

<telerik:RadSlider Width="220" TickFrequency="0.1" TickPlacement="BottomRight" IsSelectionRangeEnabled="True" Minimum="0" Maximum="1" MinimumRangeSpan="0" MaximumRangeSpan="1" SelectionStart="{Binding lower_threshold, Mode=TwoWay, Converter={StaticResource RoundDouble}, ConverterParameter=2}" SelectionEnd="{Binding upper_threshold, Mode=TwoWay, Converter={StaticResource RoundDouble}, ConverterParameter=2}" IsTabStop="False"/>

4 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 21 Jul 2011, 11:29 AM
Hi Jorn,

I can confirm that SelectionStart does not work as expected after the official Q2 release. I've logged this issue in our PITS under the name "Slider: Binding SelectionStart does not work as expected after Q2 2011" and we'll do our best to fix it for the upcoming Service Pack. As a workaround you can use the new Selection property.

<UserControl x:Class="SilverlightApplication1.MainPage"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid x:Name="LayoutRoot" Background="White">
        <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
            <telerik:RadSlider Width="500" TickFrequency="0.1" TickPlacement="BottomRight"
                    IsSelectionRangeEnabled="True" Minimum="0" Maximum="1" MinimumRangeSpan="0"
                    MaximumRangeSpan="1" Selection="{Binding Selection, Mode=TwoWay}"
                    IsTabStop="False" />
            <TextBlock Text="{Binding Selection.Start}" FontSize="24" />
            <TextBlock Text="{Binding Selection.End}" FontSize="24" />
        </StackPanel>
    </Grid>
</UserControl>

public partial class MainPage : UserControl
{
    public MainPage()
    {
        InitializeComponent();
        this.DataContext = new DataItem();
    }
}

public class DataItem : INotifyPropertyChanged
{
    private SelectionRange<double> selection = new SelectionRange<double>(0.2, 0.6);
 
    public SelectionRange<double> Selection
    {
        get
        {
            return this.selection;
        }
        set
        {
            if (this.selection != value)
            {
                this.selection = value;
                this.OnPropertyChanged("Selection");
            }
        }
    }
 
    public event PropertyChangedEventHandler PropertyChanged;
 
    private void OnPropertyChanged(string propertyName)
    {
        if (this.PropertyChanged != null)
        {
            this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

Give it a try and let me know if it works for you. I've also updated your Telerik points accordingly.

Kind regards,
Kiril Stanoev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Trude
Top achievements
Rank 2
answered on 25 Aug 2011, 10:05 AM
Internal build 0823 seems to have fixed this!
0
Trude
Top achievements
Rank 2
answered on 14 Nov 2011, 02:12 PM
The latest couple of internal releases seems to have introduced this bug again! Can you please fix this?
0
Petar Mladenov
Telerik team
answered on 17 Nov 2011, 01:28 PM
Hi Jorn,

 Could you please elaborate more on your scenario, what is the version of this internal build that you use?
Is it the same bug with the SelectionStart from your first post or even the Selection does not work ?
In the attached solution I have prepared a sample databinding scenario which is broken in Q2 2011 and fixed in Q2 2011 SP and Official Q3 2011 (1116). The dlls in the project are from Q3 2011.
Please keep in mind, that from Q2 2011, we strongly suggest you to use the Selection property instead of SelectionStart and SelectionEnd.

Kind regards,
Petar Mladenov
the Telerik team

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

Tags
Slider
Asked by
Trude
Top achievements
Rank 2
Answers by
Kiril Stanoev
Telerik team
Trude
Top achievements
Rank 2
Petar Mladenov
Telerik team
Share this question
or