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

RadTickBar resize behavior

5 Answers 174 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Nikos
Top achievements
Rank 1
Nikos asked on 29 Feb 2012, 12:43 PM
Version: Q1 2012 .NET4

Having updated from the Q3 2010, we noticed a problem in the resize behavior of the RadTickBar, when the RadSlider is provided with a TickDataTemplate which renders textual information for each tick. While resizing the slider to a smaller size, there seems to be a point of the process after which the RadTickBar cannot keep up. From that point on, the outer ticks of the slider start to get clipped out, even though the distance between the ticks appears to be enough to fit them all. On top of that, the position of each tick at that point 
miss-matches the corresponding position of the thumb of the slider (thus proving that the slider it self has resized successfully, while the tick-bar has not).

We have tried to set a MinWidth for the RadTickBar through the TickBarStyle property, however that causes an InvalidOperationException. Perhaps that is something you could check as well.

The following is the sample code which reproduces this behavior. To do so, just execute it and try to gradually resize the window to a smaller size. Plus, as far as the second issue (regarding the RadTickBar MinWidth) is concerned, try uncommenting the corresponding XAML code, and executing the project.

Yours faithfully,
Nikos Nakas
Entersoft SA Development Department

Window XAML markup:

<Window x:Class="MainWindow"
        xmlns:local="clr-namespace:WpfRadSliderTest"
        Title="MainWindow" Height="350" Width="525">
  <Window.Resources>
    <local:IntegerToMonthConverter x:Key="intToMonthConv" />
  </Window.Resources>
  <Grid>
    <telerik:RadSlider Margin="25" VerticalAlignment="Center"
                       telerik:StyleManager.Theme="Windows7"
                       Minimum="0" Maximum="5" TickFrequency="1"
                       IsMouseWheelEnabled="True" IsSnapToTickEnabled="True" IsMoveToPointEnabled="True"
                       TickPlacement="BottomRight">
      <telerik:RadSlider.TickTemplate>
        <DataTemplate>
          <Grid Background="Purple"
                MinHeight="{Binding Path=ActualHeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType=telerik:RadTickBar}}">
            <StackPanel>
              <Ellipse Width="5" Height="5" Fill="Black" />
              <Label Content="{Binding Mode=OneWay, Converter={StaticResource intToMonthConv}}" Foreground="Yellow" />
            </StackPanel>
          </Grid>
        </DataTemplate>
      </telerik:RadSlider.TickTemplate>
      <!--<telerik:RadSlider.TickBarStyle>
        <Style TargetType="telerik:RadTickBar">
          <Setter Property="MinWidth" Value="50" />
        </Style>
      </telerik:RadSlider.TickBarStyle>-->
    </telerik:RadSlider>
  </Grid>
</Window>

Value Converter:

Public Class IntegerToMonthConverter
  Implements IValueConverter
 
  Private Shared ReadOnly Months As String() = {"January", "February", "March", "April", "May", "June"}
 
  Public Function Convert(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
    Dim index = CInt(value)
    If index < 0 OrElse index >= Months.Length Then Return String.Empty
    Return Months(index)
  End Function
 
  Public Function ConvertBack(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
    Throw New NotSupportedException
  End Function
 
End Class

5 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 29 Feb 2012, 04:49 PM
Hello Nikos,

Thank you for contacting us. I can confirm that the latest version of RadSlider does have the issue you describe. Unfortunately we are not aware of an existing workaround. I've logged this issue in our PITS under the name "Slider: Clips ticks while resizing" and it will be available for tracking and voting tomorrow the latest. We will do our best to fix this issue for the upcoming Service Pack, which is scheduled for the second half of March. Let me know how this timeframe works for you. I've also updated your Telerik points accordingly.

Greetings,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Nikos
Top achievements
Rank 1
answered on 14 Jun 2012, 07:35 AM
Greetings,

I would like to inform you that this issue still exists in Q2 2012 version. Is there any estimation/timeline about its resolvement?

Yours faithfully,
Nikos Nakas
Entersoft SA Development Department 
0
Stefan
Telerik team
answered on 14 Jun 2012, 01:32 PM
Hi Nikos,

Unfortunately the issue is still reproducible because at the moment the design and the implementation of the RadSlider control don't support this functionality.

There is a possible workaround of the problem - you can set a MinWidth of the RadSlider and optionally put it in a ScrollViewer. Then even if the window is resized the labels wouldn't be misplaced.

Also we will highly appreciate it if you can tell us what you expect to happen with the labels in your scenario when the window is shrunk. This will allow us to use your feedback when discussing future improvements of the control.

Greetings,
Stefan
the Telerik team

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

0
Nikos
Top achievements
Rank 1
answered on 15 Jun 2012, 11:51 AM
Hello Stefan,

What we would expect as standard behavior would be the one we already experience in version Q3 2010; i.e. the RadTickBar is able to keep resizing without misplacing the ticks, instead the ticks start to overlap one another as soon as the margin among them is depleted.

However I should stress out that it is not the current behavior itself that troubles us, but more likely the point out of which it starts to produce itself; i.e. the margin the ticks require among them so that the RadTickBar will not misplace them (and clip the outer ones as well) is just too big. In this sense, in order to correctly display a RadSlider, it is imperative to use much more space that it used to. For some of our scenaria such an option is feasible, for others however it is not. Thus, it is impossible for us to globally adopt to the slider's new behavior, and that is critical, since the slider is an essential & irreplaceable component of our system.

We have been trying to upgrade to a newer version of Rad Controls ever since Q1 2011, however due to various issues which occurred every time (and most of which unfortunately, couldn't be reproduced outside the scope of our application), we never managed to do so successfully. This time, the only thing holding us back seems to be the RadSlider behavior. Thus, it would be most fortunate for us if you could tend to this issue.

Yours sincerely,
Nikos Nakas
Entersoft SA Development Department  
0
Stefan
Telerik team
answered on 20 Jun 2012, 08:02 AM
Hello Nikos,

Thank you for your feedback. I can see your point and we will put the RadTickBar's behavior under consideration. We will keep you updated on this.

Greetings,
Stefan
the Telerik team

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

Tags
Slider
Asked by
Nikos
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Nikos
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or