2 Gauges on 1 page cause an error only if the 'RangeColorMode' of my radialbars (in both) is set to "ProportionalBrush"

6 posts, 1 answers
  1. Zero Gravity Chimp
    Zero Gravity Chimp avatar
    40 posts
    Member since:
    Dec 2009

    Posted 08 Jun 2010 Link to this post

    Are you aware of this problem? would you prefer me to send a sample application illustrating this occurence?

    In my situation i am Collapsing and restoring the gauges. when i bring the second gauge to Visibility.Visible it causes an error. If i take out that setting it does not occur. the error also occurs if both gauges are set to 'visible' right from the start.

    Please let me know if this is clear and useful or not

    Regards
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 09 Jun 2010 Link to this post

    Hi Paul,

    Thank you for your feedback. We were able to reproduce the problem using your description. Unfortunately there is no workaround I could suggest right now and I deeply apologize for that. The bug will be fixed in the nearest internal build.

    Regards,
    Andrey
    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.
  3. DevCraft banner
  4. Zero Gravity Chimp
    Zero Gravity Chimp avatar
    40 posts
    Member since:
    Dec 2009

    Posted 09 Jun 2010 Link to this post

    Thank you for the response.

    I was also using the radialbar with just 'default' mode on and userangecolor = true in the above scenario. It seems to me that the radialbar does not take the same colour as the range. I have tried to ensure that I'm using normal colors like "red" instead of resources or hex codes in my range colour properties.

    This was working for my circular gauge, but when i started using 2 gauges (and changed from proportionalbrush to default because of the above problem) it stopped working correctly for both of my gauges, so i've given up using the radialbars for now.

    Have you managed to recreate any of the 'userangecolor' issues i have just described? let me know if you need more information or testing.

    Thanks again,

    Paul
  5. Zero Gravity Chimp
    Zero Gravity Chimp avatar
    40 posts
    Member since:
    Dec 2009

    Posted 09 Jun 2010 Link to this post

    Hi,

    Sorry to pile on these errors, I fully expect that I'm doing something wrong, but regardless I have a question.

    When I use a Linear gauge, with a "LinearBar" in the indicatorlist, setting the "UseRangeColor" to true on that element seems to create some problems. Edit: i am using the same project with multiple gauges on it, and that could be a part of the cause.

    Firstly, I don't find the bar using the range colour at all but rather the colours from the default theme (is it Office_Black?).

    Other than that, If i try to render the gauge whilst the value is 0, it seems to fail and i get the following error:

    Object reference Not set to an instance of an object.

    Please see attached for the full stack trace.
  6. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 10 Jun 2010 Link to this post

    Hi Paul,

    I've tested how the linear and radial bar work with range colors in the default mode. Wvwrything seems to work as expected. The bar indicator (either radial or linear) takes a color specified in the “IndicatorBackground” property of the range definition. Please, check whether this property is specified in your ranges.

    Unfortunately I was not able to reproduce the problem with “Object reference Not set to an instance of an object” exception. Radial and Linear scales work fine with indicator’s value set to 0 or even do not set at all when rendering. Could you please provide us with an example (XAML and code) which we could use to reproduce the problem?

    Best wishes,
    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.
  7. Zero Gravity Chimp
    Zero Gravity Chimp avatar
    40 posts
    Member since:
    Dec 2009

    Posted 10 Jun 2010 Link to this post

    Hi again.

    I have been changing the various settings of my gauge trying to get this to work and I finally came upon the reason for the error. I will post the incorrect code and the correct code below to explain what I'd done wrong.

    Incorrect:
    <gauge:LinearScale x:Name="linearScale" Min="0" Max="10"
                                        <gauge:LinearRange x:Name="Greenl" Min="0" Max="33"  
                                                           StartWidth=".01" 
                                                           EndWidth=".01" 
                                                           Background="{StaticResource Brush1}" 
                                                           IndicatorBackground="{StaticResource Brush1}"/> 
                                        <gauge:LinearRange x:Name="Yellowl" Min="33" Max="66"  
                                                           StartWidth=".01" 
                                                           EndWidth=".01" 
                                                           Background="{StaticResource Brush2}" 
                                                           IndicatorBackground="{StaticResource Brush2}"/> 
                                        <gauge:LinearRange x:Name="Redl" Min="66" Max="100"  
                                                           StartWidth=".01" 
                                                           EndWidth=".01" 
                                                           Background="{StaticResource Brush3}" 
                                                           IndicatorBackground="{StaticResource Brush3}"/> 
                                    <gauge:IndicatorList> 
                                        <gauge:LinearBar Name="linearBar" UseRangeColor="True" /> 
                                    </gauge:IndicatorList> 
                                </gauge:LinearScale> 

    I am missing the "gauge:RangeList" property as below

    (where xmlns:gauge="clr-namespace:Telerik.Windows.Controls.Gauges;assembly=Telerik.Windows.Controls.Gauge" xmlns:d="http://schemas.microsoft.com/expression/blend/2008")

     <gauge:LinearScale x:Name="linearScale" Min="0" Max="10"
                                    <gauge:RangeList> 
                                        <gauge:LinearRange x:Name="Greenl" Min="0" Max="33"  
                                                           StartWidth=".01" 
                                                           EndWidth=".01" 
                                                           Background="{StaticResource Brush1}" 
                                                           IndicatorBackground="{StaticResource Brush1}"/> 
                                        <gauge:LinearRange x:Name="Yellowl" Min="33" Max="66"  
                                                           StartWidth=".01" 
                                                           EndWidth=".01" 
                                                           Background="{StaticResource Brush2}" 
                                                           IndicatorBackground="{StaticResource Brush2}"/> 
                                        <gauge:LinearRange x:Name="Redl" Min="66" Max="100"  
                                                           StartWidth=".01" 
                                                           EndWidth=".01" 
                                                           Background="{StaticResource Brush3}" 
                                                           IndicatorBackground="{StaticResource Brush3}"/> 
                                    </gauge:RangeList> 
                                    <gauge:IndicatorList> 
                                        <gauge:LinearBar Name="linearBar" UseRangeColor="True" /> 
                                    </gauge:IndicatorList> 
                                </gauge:LinearScale> 

       

    Without the ranges being placed inside a RangeList, the stack trace that i screenshotted for you will occur. Changning the "RangeColorMode" or "UseRangeColor" in that scenario will sometimes cause no error to be thrown, but without the RangeList element it will not render correctly.

    I hope this helps someone!

    Paul
Back to Top
DevCraft banner