Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Error when dragging column over header with an underscore

Sort Posts: Previous Next
  •  05-07-2008, 2:49 PM Post no. 12047

    Error when dragging column over header with an underscore

    I'm getting the following exception when dragging a column over another column that has an underscore in the column header name.  The error occurs when the mousing over the actual column header text, but not the empty space within the column header.  However, I found that the error does not occur if I remove the underscore from the header name.

    System.InvalidOperationException

    'System.Windows.Documents.Run' is not a Visual or Visual3D.

       at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
       at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)
       at Xceed.Utils.Wpf.DragDrop.DragSourceManager.GetDropTargetAtPoint(MouseEventArgs e)
       at Xceed.Utils.Wpf.DragDrop.DragSourceManager.Drag(MouseEventArgs e)
       at Xceed.Utils.Wpf.DragDrop.DragSourceManager.ProcessMouseMove(MouseEventArgs e)
       at Xceed.Wpf.DataGrid.ColumnManagerCell.OnMouseMove(MouseEventArgs e)
       at System.Windows.UIElement.OnMouseMoveThunk(Object sender, MouseEventArgs e)
       at System.Windows.Input.MouseEventArgs.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(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)

    Are there any other workarounds besides removing the underscore?

  •  05-07-2008, 10:12 PM Post no. 12060 in reply to 12047

    Re: Error when dragging column over header with an underscore

    I was not able to reproduce the error you are reporting. Would it be possible for you to provide more information, such as column settings, or send a repro application to support@xceedsoft.com?
    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
  •  05-10-2008, 3:57 PM Post no. 12148 in reply to 12060

    Re: Error when dragging column over header with an underscore

    Hi Jenny,

    You can reproduce the error by setting a column header with underscores, like "Text_001". When you drag this header, you should see the exception.

    I fixed a samilar error in our application before. The reason is when trying to get the e.OriginalSource from the MouseButtonEventArgs to get the drag UIElement, if there are undersocres in the text, WPF will return System.Windows.Documents.Run instead of UIElement.

    Hope you can get some ideas from my message and fix the error.

     

     

  •  05-12-2008, 8:05 AM Post no. 12160 in reply to 12148

    Re: Error when dragging column over header with an underscore

    I set the Title property to a string with an underscore in it and was not able to reproduce the error. How are you setting the title?

    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.