This is a migrated thread and some comments may be shown as answers.

RadTreeView with columns error

3 Answers 74 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Lauren Nickerson
Top achievements
Rank 1
Lauren Nickerson asked on 02 Sep 2009, 05:37 PM
Hello, I'm using your RadTreeView with Columns example and a few days ago, I started getting these two strange exceptions, they seem to be in the RadTreeViewItem code, so I can't trace them.

Error 1) When I call the Clear() event from the RadTreeView

Message:

"Object reference not set to an instance of an object."

Stack trace:

   at Telerik.Windows.Controls.RadTreeViewItem.HandleSingleClickFunctionality() in c:\Builds\WPF_Scrum\Navigation_WPF\Sources\Development\Controls\Navigation\TreeView\RadTreeViewItem.Events.cs:line 439
   at Telerik.Windows.Controls.RadTreeViewItem.OnHeaderMouseLeftButtonUp(Object sender, MouseEventArgs e) in c:\Builds\WPF_Scrum\Navigation_WPF\Sources\Development\Controls\Navigation\TreeView\RadTreeViewItem.Events.cs:line 863
   at System.Windows.Input.MouseButtonEventArgs.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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.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 args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(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, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

Error 2) When I click on a RadTreeViewItem to select it.

Message:

"The specified Visual and this Visual do not share a common ancestor, so there is no valid transformation between the two Visuals."

Stack Trace:

"   at System.Windows.Media.Visual.TransformToVisual(Visual visual)\r\n   at Telerik.Windows.Controls.RadTreeViewItem.get_IsInViewport() in c:\\Builds\\WPF_Scrum\\Navigation_WPF\\Sources\\Development\\Controls\\Navigation\\TreeView\\RadTreeViewItem.Properties.cs:line 434\r\n   at Telerik.Windows.Controls.RadTreeViewItem.BringIntoView() in c:\\Builds\\WPF_Scrum\\Navigation_WPF\\Sources\\Development\\Controls\\Navigation\\TreeView\\RadTreeViewItem.cs:line 341\r\n   at Telerik.Windows.Controls.RadTreeViewItem.OnIsSelectedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs args) in c:\\Builds\\WPF_Scrum\\Navigation_WPF\\Sources\\Development\\Controls\\Navigation\\TreeView\\RadTreeViewItem.Properties.cs:line 1161\r\n   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)\r\n   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)\r\n   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)\r\n   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)\r\n   at Telerik.Windows.Controls.RadTreeViewItem.set_IsSelected(Boolean value) in c:\\Builds\\WPF_Scrum\\Navigation_WPF\\Sources\\Development\\Controls\\Navigation\\TreeView\\RadTreeViewItem.Properties.cs:line 417\r\n   at Telerik.Windows.Controls.RadTreeView.SelectionChanger_SelectionChanged(Object sender, SelectionChangedEventArgs e) in c:\\Builds\\WPF_Scrum\\Navigation_WPF\\Sources\\Development\\Controls\\Navigation\\TreeView\\RadTreeView.cs:line 2735\r\n   at Telerik.Windows.Controls.SelectionChanger`1.InvokeSelectionChangedEvent() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Controls\\Common\\SelectionChanger.cs:line 322\r\n   at Telerik.Windows.Controls.SelectionChanger`1.End() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Controls\\Common\\SelectionChanger.cs:line 74\r\n   at Telerik.Windows.Controls.RadTreeView.SetSelectedItem(RadTreeViewItem itemContainer) in c:\\Builds\\WPF_Scrum\\Navigation_WPF\\Sources\\Development\\Controls\\Navigation\\TreeView\\RadTreeView.cs:line 2687\r\n   at Telerik.Windows.Controls.RadTreeView.HandleItemSelectionFromUI(RadTreeViewItem itemToSelect) in c:\\Builds\\WPF_Scrum\\Navigation_WPF\\Sources\\Development\\Controls\\Navigation\\TreeView\\RadTreeView.cs:line 2133\r\n   at Telerik.Windows.Controls.RadTreeViewItem.OnHeaderMouseLeftButtonDown(Object sender, MouseButtonEventArgs e) in c:\\Builds\\WPF_Scrum\\Navigation_WPF\\Sources\\Development\\Controls\\Navigation\\TreeView\\RadTreeViewItem.Events.cs:line 846\r\n   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)\r\n   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)\r\n   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)\r\n   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)\r\n   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)\r\n   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)\r\n   at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)\r\n   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)\r\n   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)\r\n   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)\r\n   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)\r\n   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)\r\n   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)\r\n   at System.Windows.Input.InputManager.ProcessStagingArea()\r\n   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)\r\n   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)\r\n   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)\r\n   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)\r\n   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)\r\n   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)"

If you need more info I can show you the dissasembly. Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 07 Sep 2009, 01:01 PM
Hi Lauren,

Thank you for reporting this issue,

Unfortunately I could not reproduce the exceptions. I used the project from the thread you linked to and I added the latest assemblies. I could select and call Items.Clear() with no exceptions. Quite possibly there is something that I am missing.

The second exception actually is part of a bug of BringIntoView which will be fixed with the coming internal build. I will also add the necessary checks in the HandleSingleClickFunctionality method (the first exception). Hopefully with these checks the errors will disappear for you.

If you provide more information and possibly send a breaking project, we will make sure that the issues are fixed.

Your Telerik Points have been updated for your feedback,

Regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mark
Top achievements
Rank 1
answered on 02 Oct 2009, 11:30 AM
Hi,
Has this 2nd issue (the BringIntoView exception) been fixed?

Thanks,
Mark
0
Miroslav
Telerik team
answered on 05 Oct 2009, 12:18 PM
Hi Mark,

Yes, I confirmed that in the Latest Internal Build there is code that should handle this case.

Do you still encounter a problem there?

All the best,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
Lauren Nickerson
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Mark
Top achievements
Rank 1
Share this question
or