Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Gauges > Dynamicly adding a RangeList to a Radial Gauge

Answered Dynamicly adding a RangeList to a Radial Gauge

Feed from this thread
  • Posted on Oct 10, 2011 (permalink)

    I am trying to add ranges to a Radial Gauge.  Code snippet:
    RangeList oRangeList = new RangeList();
    double nextRangeMinimum = 0;
                         
    foreach ( QualitativeRange oRange in _ViewModel.BulletGraphRanges )
    {
        RadialRange oRadialRange = new RadialRange();
        oRadialRange.Min = nextRangeMinimum;
        oRadialRange.Max = nextRangeMinimum = oRange.Value;
        oRadialRange.BorderBrush = oRange.Brush;
        oRangeList.Add( oRadialRange );
    }


    The problem is that RangeList has no .Add member.  How do I add ranges to a RangeList?
    Thanks.
    Dan

    Nevermind.  Duh.  It's oRangeList.Items.Add
    All better now.

    Dan

    Reply

  • Answer Andrey Andrey admin's avatar

    Posted on Oct 13, 2011 (permalink)

    Hello Dan,

    You can add ranges to the radial scale using the following code:

    private void SetupRange(double newMin, double newMax, Color color)
    {
        RadialRange range = new RadialRange()
        {
            Min = newMin,
            Max = newMax,
            StartWidth = 0.1,
            EndWidth = 0.1,
            Background = new SolidColorBrush(color)
        };
     
        radialScale.Ranges.Add(range);
    }


    Greetings,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Gauges > Dynamicly adding a RangeList to a Radial Gauge
Related resources for "Dynamicly adding a RangeList to a Radial Gauge"

WPF Gauge Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]