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

Programmatic Ranges FYI

5 Answers 91 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.
Nathan
Top achievements
Rank 2
Nathan asked on 28 Jan 2010, 10:12 PM
Hey,

Just ran into an issue with programmatically assigning ranges. For example I want the user to let me know what value is "red" or "green", and display the gauge appropriately. This all works great except when the user changes the value where "good meets bad".

If I try the following line of code to remove previous ranges, I get "Exception of type 'System.ExecutionEngineException' was thrown" on the line after this executes:
        If radialScale1.Ranges.Count > 0 Then  
            radialScale1.Ranges.Clear()  
        End If 

However if I don't remove previous ranges, it causes other odd behavior since the ranges are stacked.
While recreating this scenario in a new test project, I did find a work around:
        While radialScale1.Ranges.Count > 0  
            radialScale1.Ranges.RemoveAt(0)  
        End While 

In any case I have a workaround but thought I would post this for anyone having a similar issue and so that Telerik is aware of this potential problem. Wouldn't using the clear method be the recommended approach?

Nathan

5 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 29 Jan 2010, 08:32 AM
Hi Nathan,

Thank you for the feedback.
Of course it is more understandable and useful to use Clear method instead of removing each range in a loop. We will fix the problem with exception in future releases.

All the best,
Andrey Murzov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tim
Top achievements
Rank 1
answered on 28 Mar 2010, 07:11 PM
This also happens when clearing the IndicatorList.  Has this been fixed in the latest release?
0
Andrey
Telerik team
answered on 31 Mar 2010, 07:54 AM
Hello Tim,

We've added new method to the scale objects: ClearList<T>()
You can use it to clear lists in the scale (indicators and ranges). For example:
scale.ClearList<RangeList>();

Greetings,
Andrey Murzov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
jfkrueger
Top achievements
Rank 1
answered on 18 May 2011, 06:28 PM
I'm sorry, I am very new to Silverlight...

How do you get the RangeList to pass to the ClearList method?

Thanks!
0
Andrey
Telerik team
answered on 23 May 2011, 10:57 AM
Hello jfkrueger,

The scale object can contain 1 RangeList only. So just add this line to your code to clear range list:

scale.ClearList<RangeList>();

Kind regards,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Gauge
Asked by
Nathan
Top achievements
Rank 2
Answers by
Andrey
Telerik team
Tim
Top achievements
Rank 1
jfkrueger
Top achievements
Rank 1
Share this question
or