ArguementNullException

3 posts, 0 answers
  1. William
    William avatar
    2 posts
    Member since:
    Sep 2010

    Posted 28 Oct 2010 Link to this post

    I'm playing around with radGauge and have encountered the following ArguementNullException:

    System.ArgumentNullException occurred
      Message=Value cannot be null.
    Parameter name: reference
      Source=PresentationCore
      ParamName=reference
      StackTrace:
           at System.Windows.Media.VisualTreeHelper.HitTest(Visual reference, Point point)
           at Telerik.Windows.Controls.Gauges.GaugeHelper.CheckPointOver(FrameworkElement element, Point point) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Gauge\GaugeHelper.cs:line 62
      InnerException:

    Here's the xaml code used to produce it.  I'm trying to have a gauge with no numerical legends or tick marks with a 360 degree sweep, going from -180 degrees to 180 degrees, with 0 at the top.

    <telerik:RadGauge Name="myGauge" Style="{StaticResource gaugeRadGaugeStyle}" >
        <telerik:RadialGauge>
            <telerik:RadialScale Name="radialScale" Min="-180" Max="180" SweepAngle="360" StartAngle="90" >
                <telerik:RadialScale.Label>
                    <telerik:LabelProperties Foreground="Transparent" />
                </telerik:RadialScale.Label>
                <telerik:RadialScale.Ticks>
                    <telerik:TickProperties Foreground="Transparent" />
                    <!--<telerik:MinorTickProperties Foreground="Transparent" />-->
                </telerik:RadialScale.Ticks>
                <telerik:RangeList>
                    <telerik:RadialRange Name="SynchroscopeRange" Style="{StaticResource gaugeRadialRangeStyle}" />
                </telerik:RangeList>
                <telerik:IndicatorList>
                    <telerik:Needle Name="needle" IsAnimated="true" Value="{Binding Value}"/>
                </telerik:IndicatorList>
            </telerik:RadialScale>
        </telerik:RadialGauge>
    </telerik:RadGauge>

    Any insight you can provide would be most appreciated!

    Thanks!
    Bill G
  2. William
    William avatar
    2 posts
    Member since:
    Sep 2010

    Posted 28 Oct 2010 Link to this post

    Additional: 

    This error is consistent.  The null reference exception happens every time I run in debug mode.

    If is is helpful, I have a screenshot of my call stack when I get this error.  Since I couldn't paste it into the blog, it is available on my personal web server.

    Thanks,
    Bill Gross
  3. UI for WPF is Visual Studio 2017 Ready
  4. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 02 Nov 2010 Link to this post

    Hi William,

    The problem seems to be here:

    <telerik:RadialScale.Ticks
         <telerik:TickProperties Foreground="Transparent" /> 
         <!--<telerik:MinorTickProperties Foreground="Transparent" />-->
    </telerik:RadialScale.Ticks

    You can't use Ticks property of the RadialScale this way, and you can't use TickProperties element in the RadialScale.Ticks list. The only elements are allowed in this list are CustomTickMark elements.

    If you'd like to have gauge without legend and tick marks you should simply set MajorTicks property of the RadialScale object to -1. For example:

    <telerik:RadGauge Name="myGauge" >
        <telerik:RadialGauge>
            <telerik:RadialScale Name="radialScale" 
                 Min="-180" 
                 Max="180" 
                 SweepAngle="360" 
                 StartAngle="-90" 
                 MajorTicks="-1">
                <telerik:RangeList>
                    <telerik:RadialRange Name="SynchroscopeRange"  />
                </telerik:RangeList>
                <telerik:IndicatorList>
                    <telerik:Needle Name="needle" IsAnimated="true" Value="{Binding Value}"/>
                </telerik:IndicatorList>
            </telerik:RadialScale>
        </telerik:RadialGauge>
    </telerik:RadGauge>

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