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

RadSlider SelectionEnd problem

1 Answer 166 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Yuval
Top achievements
Rank 1
Yuval asked on 16 Mar 2013, 10:09 PM
Hi,
I am using RadSlider, with range defined as follows:
telerik:RadSlider  Grid.Column="1"  VerticalAlignment="Center"
                                    Minimum="{Binding MinVal, Mode=OneWay}"
                                    Maximum="{Binding MaxVal, Mode=OneWay}"
                                    IsSelectionRangeEnabled="True"
                                    IsCoercionSuppressed="True"
                                    SelectionStart="{Binding LowValue, Mode=TwoWay}"
                                    SelectionEnd="{Binding HighValue, Mode=TwoWay}"
                                    StepAction="MoveRange"
                                    />
 
<telerik:RadNumericUpDown Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center"  Margin="2" IsInteger="True" Value="{Binding LowValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
 
<telerik:RadNumericUpDown Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Center"  Margin="2" IsInteger="True" Value="{Binding HighValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
and everything works fine.
But- when put inside a Data template, so I can have it on an itemsconrol, I get the SelectionEnd not binded at all.
Using Snoop, shows that the SelectionStart is binding to the ParentTemplate and works fine, but the SelectionEnd is 'Local'. Using the Clear/Reset in Snoop's menu- it starts working.

The data template for reference:
<DataTemplate x:Key="RangeSlider">
            <Grid Height="30" Margin="2, 0, 2, 0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="30*"/>
                    <ColumnDefinition Width="30*"/>
                    <ColumnDefinition Width="20*"/>
                    <ColumnDefinition Width="20*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Margin="2" VerticalAlignment="Center" Text="{Binding Name}" />
                <telerik:RadSlider  Grid.Column="1" Margin="2" VerticalAlignment="Center"
                                    IsSelectionRangeEnabled="True"
                                    Minimum="{Binding MinVal, Mode=OneWay}"
                                    Maximum="{Binding MaxVal, Mode=OneWay}"
                                    IsCoercionSuppressed="True"
                                    SelectionEnd="{Binding HighValue, Mode=TwoWay}"
                                    SelectionStart="{Binding LowValue, Mode=TwoWay}"
                                    StepAction="MoveRange"
                                    />
                 
                <telerik:RadNumericUpDown Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center"  Margin="2" IsInteger="True"
                         Value="{Binding LowValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                <telerik:RadNumericUpDown Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Center"  Margin="2" IsInteger="True"
                         Value="{Binding HighValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
            </Grid>
        </DataTemplate>
Appreciate any advice,

Thanks 
Yuval

1 Answer, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 20 Mar 2013, 03:44 PM
Hello Yuval,

It seems we have a bug with the SelectionEnd property in data bound scenario when used in a DataTemplate of an ItemsControl. I created a PITS item for it and you can track its progress here, I also updated your Telerik point. As a work-around you could implement a Selection property (of type SelectionRange<double>) in your ViewModel and bind directly to the Selection property of the RadSlider.

Please accept our apologies for the inconvenience caused.

Kind regards,
Kiril Vandov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Slider
Asked by
Yuval
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Share this question
or