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

Adding gauge only with code

1 Answer 61 Views
Gauges
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 25 Dec 2010, 12:10 PM
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

1 Answer, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 25 Dec 2010, 06:45 PM
After wirting it again from the beginning I've got it to work, thx anyway.
Tags
Gauges
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Share this question
or