NullReferenceException in get_ItemToolTipTimer

4 posts, 1 answers
  1. GPJ
    GPJ avatar
    31 posts
    Member since:
    Oct 2008

    Posted 01 May 2009 Link to this post

    I've got an application that updates the display every 5 mins or so and today I received this exception after it had been running for a couple hours.  I'm not using the tool tip at all so I just thought I'd make you aware of it.  The charts being shown are all 2D (1 pie, 1 bar and 2 line charts) and don't implement any user interactive behaviour.

    System.NullReferenceException: Object reference not set to an instance of an object.
       at Telerik.Windows.Controls.Charting.BaseChartItem.get_ItemToolTipTimer()
       at Telerik.Windows.Controls.Charting.BaseChartItem.HideToolTip()
       at Telerik.Windows.Controls.Charting.BaseChartItem.BaseChartItemMouseLeave(Object sender, MouseEventArgs e)
       at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.MouseOverProperty.FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, Boolean oldValue)
       at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
       at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
       at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
       at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
       at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
       at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, DeferredElementTreeState& oldTreeState)
       at System.Windows.Input.MouseDevice.ChangeMouseOver(IInputElement mouseOver, Int32 timestamp)
       at System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.MouseDevice.Synchronize()
       at System.Windows.Input.MouseDevice.OnHitTestInvalidatedAsync(Object sender, EventArgs e)
       at System.Windows.Input.InputManager.HitTestInvalidatedAsyncCallback(Object arg)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
     



  2. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 04 May 2009 Link to this post

    Hi Greg Peter Joyal,

    Thank you very much for contacting us. From the stack trace it appears that the exception occured a little after a mouse leave event was triggered. Can you confirm if the excepttion occured immediately after the mouse was moved over the chart control?

    Also, can you please share the update code for the chart control? 

    Thanks a lot in advance!

    Best wishes,
    Vladimir Milev
  3. UI for WPF is Visual Studio 2017 Ready
  4. GPJ
    GPJ avatar
    31 posts
    Member since:
    Oct 2008

    Posted 04 May 2009 Link to this post

    Hi Vladimir.

    That's the funny thing about the exception...  The application that crashed is a "dashboard" application to show status and nobody was moving the mouse at the time.  The dashboard has 1 carousel, 1 pie chart, 1 bar chart, and 3 line charts on it (as well as some traditional stuff like listboxes). The only thing I can think of is that the mouse cursor was over a chart when we refreshed it (at a 5 minute interval).

    Here is the code that is called when one of the charts is initially displayed & refreshed.  They all update in similar ways (obviously with different Series Definitions depending on the style).

            /// <summary>  
            /// Refreshes the data.  
            /// </summary>  
            void RefreshData()  
            {  
                // clear out the old series  
                MyChart.SeriesMappings.Clear();  
     
                // Fill with the new data  
                GetChartData();  
            }  
     
            /// <summary>  
            /// Gets the chart data.  
            /// </summary>  
            private void GetChartData()  
            {  
                MyChart.Visibility = Visibility.Visible;  
                MyChart.DefaultView.ChartArea.DataSeries.Clear();  
     
                var areaSeries = new DataSeries{Definition = new LineSeriesDefinition()};  
                MyChart.DefaultView.ChartArea.DataSeries.Add(areaSeries);  
                foreach (IMyData dataDetail in _dataList)  
                    areaSeries.Add(new DataPoint(dataDetail .Period, dataDetail .Value));  
     
                MyChart.DefaultView.ChartArea.AxisY.AutoRange = true;  
                MyChart.DefaultView.ChartArea.AxisY.MinValue = 0;  
                MyChart.DefaultView.ChartArea.AxisY.Visibility = Visibility.Visible;  
                MyChart.DefaultView.ChartArea.AxisX.Visibility = Visibility.Collapsed;  
     
                MyChart.DefaultView.ChartLegend.Visibility = Visibility.Collapsed;  
                MyChart.DefaultSeriesDefinition = new LineSeriesDefinition();  
            }  
        } 

    Thanks,
    Greg
  5. Answer
    Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 07 May 2009 Link to this post

    Hello Greg Peter Joyal,

    Thanks for the info. We will investigate this issue. In the meantime I can recommend that you set "ShowItemsTooltips" on the series definitions you have to false if you are not using them. I also have your email and will contact you about the other problems you guys encountered if we need additional info.

    Regards,
    Vladimir Milev
Back to Top