Programmatic Ranges FYI

6 posts, 0 answers
  1. Nathan
    Nathan avatar
    24 posts
    Member since:
    Sep 2009

    Posted 28 Jan 2010 Link to this post

    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
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 29 Jan 2010 Link to this post

    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.
  3. DevCraft banner
  4. Tim
    Tim avatar
    85 posts
    Member since:
    Aug 2008

    Posted 28 Mar 2010 Link to this post

    This also happens when clearing the IndicatorList.  Has this been fixed in the latest release?
  5. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 31 Mar 2010 Link to this post

    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.
  6. jfkrueger
    jfkrueger avatar
    269 posts
    Member since:
    Jul 2012

    Posted 18 May 2011 Link to this post

    I'm sorry, I am very new to Silverlight...

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

    Thanks!
  7. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 23 May 2011 Link to this post

    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
Back to Top
DevCraft banner