RadTrackBar w/ High Maximum Slows Down Application

2 posts, 0 answers
  1. Brett
    Brett avatar
    1 posts
    Member since:
    Mar 2014

    Posted 02 Apr 2014 Link to this post

    We're trying to add a RadTrackBar control to our application with the following settings:

     - LabelStyle = BottomRight
     - LargeChange = 100
     - LargeTickFrequency = 1000
     - Maximum = 10000
     - Orientation = Vertical
     - SmallTickFrequency = 250

    Whenever you try to run the application, even on one where this is the only control on the form, it takes close to a minute for the application to finally fully load and display.

    If I decrease the Maximum it seems to run faster, so is there some sort of limitation on this control?

    Is there anyway to get it to work so that we can keep our maximum of 10000?
  2. George
    George avatar
    500 posts

    Posted 07 Apr 2014 Link to this post

    Hi Brett,

    Thank you for contacting us.

    Actually, there is a limitation of the maximum amount of ticks RadTrackBar can have. It is due to the fact that each tick is 2 pixels wide and when you set the Maximum to 10000 you basically want to fit 20000 pixels into 1920 pixels, for example. You will need to use a different approach here. You can set the maximum of your RadTrackBar to 100. Then in the LabelFormatting event you can increase multiply each value by 100 and have correct labels:
    void Form1_LabelFormatting(object sender, LabelFormattingEventArgs e)
        if (!string.IsNullOrEmpty(e.LabelElement.Text))
            e.LabelElement.Text = (int.Parse(e.LabelElement.Text) * 100).ToString();

    Then you can set the SnapMode to None and every time you get the value to multiply it by 100 too. This will result in a high performance RadTrackBar which still shows correct values up to 10000.

    Moreover, I see that you have set the Orientation property to Vertical, we have an internal issue which is related to that property. I have exposed it for your convenience and you can find it here.

    I hope this information is helpful. Let me know if you have further questions.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top