Randomly getting exception in RadTreeView.InheritTreeProperties

7 posts, 0 answers
  1. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 02 Nov 2011 Link to this post

    Hi,

    I'm using WPF controls version 2011.2.712.35.
    Randomly getting following exception below.

    If there is a workaround to this exception please let me know.

    Thanks,
    Ruben

    at Telerik.Windows.Controls.RadTreeView.InheritTreeProperties(RadTreeViewItem treeViewItem) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TreeView\RadTreeView.CommonItemContainer.cs:line 600
    at Telerik.Windows.Controls.RadTreeView.PrepareContainerForDescendant(DependencyObject element, Object item, ItemsControl owner) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TreeView\RadTreeView.CommonItemContainer.cs:line 152
    at Telerik.Windows.Controls.RadTreeViewItem.PrepareContainerForItemOverride(DependencyObject element, Object item) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TreeView\RadTreeViewItem.cs:line 1513
    at System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item)
    at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
    at Telerik.Windows.Controls.TreeView.TreeViewPanel.InsertContainer(Int32 childIndex, UIElement container, Boolean isRecycled) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TreeView\Virtualization\TreeViewPanel.cs:line 2257
    at Telerik.Windows.Controls.TreeView.TreeViewPanel.AddContainerFromGenerator(Int32 childIndex, UIElement child, Boolean newlyRealized) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TreeView\Virtualization\TreeViewPanel.cs:line 2309
    at Telerik.Windows.Controls.TreeView.TreeViewPanel.MeasureOverride(Size constraint) in c:\TB\101\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TreeView\Virtualization\TreeViewPanel.cs:line 1454
    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 System.Windows.Threading.DispatcherOperation.InvokeImpl()
    at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
    at System.Threading.ExecutionContext.runTryCode(Object userData)
    at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Windows.Threading.DispatcherOperation.Invoke()
    at System.Windows.Threading.Dispatcher.ProcessQueue()
    at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    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 System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.Run()
    at System.Windows.Application.RunDispatcher(Object ignore)
    at System.Windows.Application.RunInternal(Window window)
    at System.Windows.Application.Run(Window window)
    at System.Windows.Application.Run()
  2. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 02 Nov 2011 Link to this post

    Looks like the exception happens in a newly added subroutine:
    private void InheritTreeProperties(RadTreeViewItem treeViewItem)
    {
        treeViewItem.ExpanderStyleInherited = (treeViewItem.ParentItem != null) ? treeViewItem.ParentItem.ExpanderStyleFinal : treeViewItem.ParentTreeView.ExpanderStyle;
    }

  3. UI for WPF is Visual Studio 2017 Ready
  4. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 07 Nov 2011 Link to this post

    Hi Rubenhak,

     Could you please elaborate more on your scenario and especially the steps you perform to reproduce this exception? This way we would be better able to investigate this and advice you.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 07 Nov 2011 Link to this post

    Petar,

    I'm using data bound TreeView control, changed item template and item container styles.
    During operations I alternate items in the tree by removing/adding items.

    The exception gives an exact line when the null pointer exception happened. I've noticed
    with Reflector that this particular chunk of code was introduced in recent version of controls.
    Also didn't notice this kind of problem in earlier releases.

    Cheers,
    Ruben
  6. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 10 Nov 2011 Link to this post

    Hello Rubenhak,

    Unfortunately, we are not aware of such or similar issue in the RadTreeView which was recently introduced.
    We will need your cooperation in order to detect this better. From the StackTrace you provided , we cannot see the type of Exception, is it NullReferenceException or something else ? Is it possible for you to capture a video showing how you use the RadTreeView, especially the exact steps you make which lead to the exception ? Any sample code would also be highly appreciated. Thank you in advance.

    Regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 10 Nov 2011 Link to this post

    Hi Petar,

    Yes, I was getting NullReferenceException. You can see that it provides a line number into that function.

    Actually, because of this issue I downgraded to version 2010.3.1110.35 which does not have this problem. It will take some time to upgrade it back to latest version and make a screen grab, but I can assure that there is a hidden problem in TreeView control.

    One more hint. Most of the time it happen when children are added/removed in node, and afterwards that particular node is getting expanded.

    Cheers,
    Ruben
  8. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 15 Nov 2011 Link to this post

    Hi Rubenhak,

     We investigated this and we tried to reproduce such exception but we did not manage. We will need a runnable sample so that we could debug it and detect the problem successfully. Thank you for your understanding.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
UI for WPF is Visual Studio 2017 Ready