affecting Gauge from code

Thread is closed for posting
2 posts, 0 answers
  1. Gary Blakely
    Gary Blakely avatar
    63 posts
    Member since:
    Jan 2010

    Posted 24 Jun 2011 Link to this post

    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.
  2. Victor
    Victor avatar
    1358 posts

    Posted 27 Jun 2011 Link to this post

    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()
        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,
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top