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

RadTrackBar w/ High Maximum Slows Down Application

1 Answer 126 Views
TrackBar
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 02 Apr 2014, 08:33 PM
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?

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 07 Apr 2014, 04:35 PM
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.

Regards,
George
Telerik
 

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.

 
Tags
TrackBar
Asked by
Brett
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or