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

affecting Gauge from code

1 Answer 38 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gary Blakely
Top achievements
Rank 1
Gary Blakely asked on 25 Jun 2011, 12:48 AM
I need to change some gauge settings from code.  For instance there is a maxValue setting in the RadialGaugeRange section.  I've tried everything I can think of but I can't figure out how to change that setting from code.  Are there docs somewhere on approaches to change other settings in code?

My app needs different settings depending upon speed i.e. Walking, riding in a car, flying in a jet.
Thanks

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 27 Jun 2011, 08:31 AM
Hello Gary Blakely,

Thank you for writing.
You need to set the x:Name property of the GaugeRange you need to modify in your XAML file. By setting this property, the Silverlight design-time environment will automatically generate an internal field that you can use in your C# code.

For example if you have a XAML file that defines a gauge range like this:
<telerikDataVisualization:RadialGaugeRange x:Name="radialRange"/>
You can refer to this radial range directly like so:
public MainPage()
{
    InitializeComponent();
    this.radialRange.MaxValue = someValue;
}
The important thing is that this.radialRange will be created inside the InitializeComponent() method. Before this method it will be null.

Please write again if you need further assistance.

Kind regards,
Victor
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
Gauge
Asked by
Gary Blakely
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or