GridView generates and System.NullReferenceException

3 posts, 1 answers
  1. Pieter
    Pieter avatar
    34 posts
    Member since:
    Jan 2011

    Posted 25 Mar 2013 Link to this post

    I have GridView 2012.3.1314.40. This view is created with EnableColumnVirtualization and EnableRowVirtualization true.
    Data is added slowly by another thread.

    When browsing this GridView I get an System.NullReferenceException with the following stack

    Error in function Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
       at Telerik.Windows.Controls.GridView.GridViewHeaderCell.SetLeftGripperVisibility()
       at Telerik.Windows.Controls.GridView.GridViewHeaderCell.HookupGripperEvents()
       at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnApplyTemplate()
       at System.Windows.FrameworkElement.ApplyTemplate()
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureCell(GridViewColumn column, GridViewCellBase cell, Size size)
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.RealizeAndMeasureCells(Int32 startIndex, Int32 predictedLastIndex, Func`2 calculateNextIndex)
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.UpdateVirtualizedCells()
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at Telerik.Windows.Controls.GridView.GridViewHeaderCell.SetLeftGripperVisibility()
       at Telerik.Windows.Controls.GridView.GridViewHeaderCell.HookupGripperEvents()
       at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnApplyTemplate()
       at System.Windows.FrameworkElement.ApplyTemplate()
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureCell(GridViewColumn column, GridViewCellBase cell, Size size)
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.RealizeAndMeasureCells(Int32 startIndex, Int32 predictedLastIndex, Func`2 calculateNextIndex)
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.UpdateVirtualizedCells()
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

    I do not know what is causing this exception and how to prevent or catch it without killing my application first.

    Any help would be appreciated.

    Pieter
  2. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 25 Mar 2013 Link to this post

    Hello Pieter,

    We have fixed a similar exception for the Q1 2013 release. Would you please download it and test if you can reproduce the issue with it?

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Pieter
    Pieter avatar
    34 posts
    Member since:
    Jan 2011

    Posted 28 Mar 2013 Link to this post

    Didie,

    Thanks for your answer!
    We did update the Telerik dll's, and indeed the problem did not occur again ever since.

    Pieter

Back to Top