NullReferenceException on click

2 posts, 0 answers
  1. Manuel
    Manuel avatar
    32 posts
    Member since:
    Sep 2013

    Posted 10 Apr 2015 Link to this post

    Hi guys, our centralized log management system reported the following unhandled exception on a customer's PC.

    It seems something related to the OnMouseLeftButtonUp event on RadToggleButton control, but I'm not able to reproduce it on my machine.

    Maybe you can help me?

    The machine is running Windows 7 SP1 32-bit (Microsoft Windows NT 6.1.7601 Service Pack 1).

    Here is the full stack trace of the error: 

    System.NullReferenceException: La reference d'objet n'est pas definie e une instance d'un objet.
     Telerik.Windows.Controls.Docking.PaneGroupBase.ShowContextMenu(PaneGroupBase paneGroup, ExecutedRoutedEventArgs e)
     Telerik.Windows.Controls.Docking.PaneGroupBase.OnContextMenuCommandInvoke(Object sender, ExecutedRoutedEventArgs e)
     System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
     System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
     System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
     System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
     System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
     System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
     System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
     System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
     System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
     System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
     System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
     System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
     System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
     System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
     MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
     System.Windows.Controls.Primitives.ButtonBase.OnClick()
     Telerik.Windows.Controls.RadToggleButton.OnClick()
     System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
     Telerik.Windows.Controls.RadToggleButton.OnMouseLeftButtonUp(MouseButtonEventArgs e)
     System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
     System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
     System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
     System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
     System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
     System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
     System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
     System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
     System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
     System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
     System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
     System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
     System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
     System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
     System.Windows.Input.InputManager.ProcessStagingArea()
     System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
     System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
     System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
     System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
     System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
     MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
     MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
     System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
     MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler).

  2. Geri
    Admin
    Geri avatar
    60 posts

    Posted 14 Apr 2015 Link to this post

    Hi Manuel,

    The error usually occurs when there is no pane selected. Therefore, a ContextMenu can not be opened and an exception is thrown.
    By design, every RadPaneGroup always has a selected pane, so you can check if there is a specific logic that interferes with the selection.

    Attached you can find a sample project where this behavior can be observed, we hope you'll find it helpful.

    Regards,
    Geri
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top