Slider with small Width...

3 posts, 1 answers
  1. Michal
    Michal avatar
    5 posts
    Member since:
    Feb 2009

    Posted 07 Oct 2009 Link to this post

    Hi.

    I updated to Q2 2009 SP1 and now I have problem with small sliders (Width less than 56).
    I use default theme (I think Office_black) and when I want to create slider with small Width it is not working right.

    For example I want to do something like this:

    myTestSlider = new Telerik.Windows.Controls.RadSlider();
    myTestSlider.IsSnapToTickEnabled = true;
    myTestSlider.TickPlacement = Telerik.Windows.Controls.TickPlacement.None;
    myTestSlider.TickFrequency = 1;
    myTestSlider.Focusable = false;
    myTestSlider.Width = 34; // 8+20+6
    myTestSlider.Minimum = 1;
    myTestSlider.Maximum = 10;
    Canvas.SetLeft(myTestSlider, 10);
    Canvas.SetTop(myTestSlider, 10);
    myTestCanvas.Children.Add(myTestSlider);

    Slider Control has width 34 but its "internal" parts look and work like on width around 56 and so right part is not visible and goes beyond right border.
    I don’t know if I am doing something wrong but currently I am not able to make small sliders.

    Best regards,
    Michal

  2. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 07 Oct 2009 Link to this post

    Hi Michal,

    Thank you for reporting this inconsistency, which is caused by a MinWidth set in the template of RadSlider. We will make sure to fix it as soon as possible. As a workaround, you can edit the ControlTemplate of RadSlider and remove the problematic MinWidth. I have attached a sample project that demonstrates how to add a RadSlider with Width="34" to a Canvas.
    Give it a try and let me know if you experience any problems or you have additional questions.

    Sincerely yours,
    Kiril Stanoev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Michal
    Michal avatar
    5 posts
    Member since:
    Feb 2009

    Posted 08 Oct 2009 Link to this post

    Hi Kiril.

    Thank you for answer, with your ControlTemplate RadSlider works correctly.

    Best regards,
    Michal
Back to Top