Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Gauges > Adding gauge only with code

Not answered Adding gauge only with code

Feed from this thread
  • David avatar

    Posted on Dec 25, 2010 (permalink)

    I'm trying to add a gauge to an existing wrapPanel but I'm doing something wrong. my code is :

    Grid newGrid = new Grid();
    RadGauge newRG =
    new RadGauge();
    LinearGauge newLG = new LinearGauge();
    LinearScale newLS = new LinearScale();
    IndicatorList newIL = new IndicatorList();
    Marker newMarker = new Marker();
     
    newIL.Items.Add(newMarker);
    newLS.Indicators.Add(newIL);
    newLG.Items.Add(newLS);
    newRG.Content = newLG;
    newGrid.Children.Add(newRG);
    GaugesWrapPanle.Children.Add(newGrid);

    The error I get is :
    "Unable to cast object of type 'Telerik.Windows.Controls.Gauges.IndicatorList' to type 'Telerik.Windows.Controls.Gauges.IGaugeIndicator'".

    Could you please write the right way for doing this?

    Thank you

    Reply

  • David avatar

    Posted on Dec 25, 2010 (permalink)

    After wirting it again from the beginning I've got it to work, thx anyway.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Gauges > Adding gauge only with code
Related resources for "Adding gauge only with code"

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