Bug? InvalidOperationException occurs once clicking a Hyperlink after WPF ScheduleView is in focus

9 posts, 0 answers
  1. Frankie
    Frankie avatar
    11 posts
    Member since:
    Jun 2011

    Posted 04 Jan 2012 Link to this post

    Hi,

    I experienced a problem in my developing the WPF application. The application consists of a RadScheduleView and many WPF Hyperlink items. Once the ScheduleView is on focus, then I click on any Hyperlink, the application hangs and shows "InvalidOperationException" in Debug mode, saying that Hyperlink is not a Visual or Visual3D.

    Full stacktrace is captured as follow:
    System.InvalidOperationException was unhandled
      Message='System.Windows.Documents.Hyperlink' is not a Visual or Visual3D.
      Source=PresentationCore
      StackTrace:
           at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
           at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)
           at Telerik.Windows.Controls.ScheduleViewBase.ScheduleViewLostFocus(Object sender, RoutedEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.InlineEditing.cs:line 368
           at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
           at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
           at System.Windows.UIElement.OnLostFocus(RoutedEventArgs e)
           at System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
           at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
           at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
           at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
           at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
           at System.Windows.DependencyObject.ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata)
           at System.Windows.DependencyObject.ClearValue(DependencyPropertyKey key)
           at System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
           at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
           at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
           at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
           at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
           at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
           at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
           at System.Windows.FrameworkContentElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
           at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
           at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
           at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
           at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
           at System.Windows.Input.InputManager.ProcessStagingArea()
           at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
           at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
           at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
           at System.Windows.ContentElement.Focus()
           at System.Windows.Documents.Hyperlink.OnMouseLeftButtonDown(Object sender, MouseButtonEventArgs e)
           at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
           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.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
           at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
           at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
           at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
           at System.Windows.Input.InputManager.ProcessStagingArea()
           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, WindowMessage 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, Int32 numArgs)
           at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
           at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, 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.Application.RunInternal(Window window)
           at System.Windows.Application.Run()
           at WpfApplication1.App.Main() in C:\Segantii\Development\Samples\Telerik\MonthViewTickStyle\WpfApplication1\WpfApplication1\obj\Debug\App.g.cs:line 0
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           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.Threading.ThreadHelper.ThreadStart()
      InnerException: 

    There will be no error if I click other UI element (e.g. TextBox) after ScheduleView is on focus.
    And I cannot find the way to catch the Exception, thus the application will hang once user click on Hyperlink after ScheduleView is on focus.

    Is that a bug?
    Thanks a lot!

    Frankie
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 09 Jan 2012 Link to this post

    Hello Frankie,

    Thank you for reporting this issue, we'll investigate it and will try to fix it for some of the internal builds.

    Kind regards,
    Yana
    the Telerik team

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Frankie
    Frankie avatar
    11 posts
    Member since:
    Jun 2011

    Posted 15 Jan 2012 Link to this post

    Hi Yana,

    Thanks for the update.
    Is there any schedule on the fix?

    Many thanks!

    Frankie
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 16 Jan 2012 Link to this post

    Hello Frankie,

    At the moment we cannot specify a certain timeframe for fixing this issue, we'll do our best to provide a fix for the official release in February.

    Greetings,
    Yana
    the Telerik team

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

  6. Frankie
    Frankie avatar
    11 posts
    Member since:
    Jun 2011

    Posted 19 Jan 2012 Link to this post

    Hi Yana,

    Then, is there any way to catch the Exception to avoid the whole application getting hanged?
    Thanks!

    Frankie
  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 23 Jan 2012 Link to this post

    Hi Frankie,

    We investigated this issue in more details and it seems that there is a problem in the framework which causes the exception, please check this forum thread for a detailed explanation.

    As a workaround you can set Focusable property of the Hyperlink to "False".

    All the best,
    Yana
    the Telerik team

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

  8. Frankie
    Frankie avatar
    11 posts
    Member since:
    Jun 2011

    Posted 26 Jan 2012 Link to this post

    Hi Yana,

    Thanks for the follow-up!
    I will use the workaround to avoid application being hanged at this moment.

    Please let me know if there is any update.
    Thanks a lot!

    Frankie
  9. dmitri
    dmitri avatar
    1 posts
    Member since:
    Apr 2010

    Posted 21 Dec 2012 Link to this post

    Hello,  I am having exactly the same issue with the hyperlink after using schedulerview. Setting hyperlink focusable property to false is NOT an option for me, as those hyperlinks are outside of my application, part of a bigger shell application. This is a showstopper, need a fix estimate asap please.
  10. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 27 Dec 2012 Link to this post

    Hello,

    We investigated the issue further and we will try to implement a permanent fix for it in our Q1 2013 release of RadControls.

    You can vote and track this issue status in our Public Issue Tracker System.

    Regards,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready