Drag and drop exceptions

17 posts, 0 answers
  1. Jorge Delgado-Lopez
    Jorge Delgado-Lopez avatar
    82 posts
    Member since:
    Aug 2007

    Posted 28 Aug 2007 Link to this post

    Hi,

    On my tests with drag and drop I am getting the following exceptions which do not seem to be thrown by my code.

    The exeptions are "Object reference not set to an instance of an object."

    at Telerik.WinControls.UI.RadTreeView.HandleDragDropCursor()
    at Telerik.WinControls.UI.RadTreeView.DoDragDrop()
    at Telerik.WinControls.UI.RadTreeView.OnMouseMove(MouseEventArgs e)
    at System.Windows.Forms.Control.WmMouseMove(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at Telerik.WinControls.RadControl.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(Form mainForm)
    at telerikevaluation.manager.StartUp.Main(String[] args) in C:\\Development\\telerik\\evaluation\\source\\RevivalManager\\StartUp.cs:line 19"


    And sometimes this as well:

    at Telerik.WinControls.UI.RadTreeView.PrepareDragDropOutlineForm()
    at Telerik.WinControls.UI.RadTreeView.BeginDrag()
    at Telerik.WinControls.UI.RadTreeView.PerformDragInitialization()
    at Telerik.WinControls.UI.RadTreeView.OnMouseMove(MouseEventArgs e)
    at System.Windows.Forms.Control.WmMouseMove(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at Telerik.WinControls.RadControl.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(Form mainForm)
    at telerikevaluation.manager.StartUp.Main(String[] args) in C:\\Development\\telerik\\evaluation\\source\\RevivalManager\\StartUp.cs:line 19"

    Any ideas?
    / jorge




  2. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 29 Aug 2007 Link to this post

    Hi j0rge,

    To be able to investigate the reason for these exceptions we will need some more information. What were the exact steps you made to get the exceptions? Which version of our controls are you using?

    It will be best if you can send us a sample project that can be used to easily reproduce the exceptions. You can do so in a new support ticket from your account.

    Thank you for your time.
     

    All the best,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. j0rge
    j0rge avatar
    7 posts
    Member since:
    May 2007

    Posted 07 Sep 2007 Link to this post

    Hi!
    Read the source and solved the problem with tree.ShowOutlineFeedbackForm = false; which is deprecated.It is a shame not to show the node while dragging. The problem occurs when I open the context menu and then click anywhere outside the context menu.

    Is there another solution for this?
    / jorge
  5. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 11 Sep 2007 Link to this post

    Hi j0rge,

    We tried to reproduce the issues you mention but to no avail. It is not clear how the context menu is related to drag and drop operations in your scenario. We will be happy to investigate the problem if you can send us a simple project demonstrating the issues. Please, open a new support ticket and attach the project in it. Thank you for your time.
     

    Regards,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Ali
    Ali avatar
    7 posts
    Member since:
    Aug 2007

    Posted 14 Jan 2008 Link to this post

    Hi,

    I am getting the same exceptions.
    It is occuring when i am clicking on the RadTreeView and moving the mouse randomly.

    Any help?

    Ali
  7. Jorge Delgado-Lopez
    Jorge Delgado-Lopez avatar
    82 posts
    Member since:
    Aug 2007

    Posted 14 Jan 2008 Link to this post

    Hi Ali,

    I solved it by removing all my drag and drop logic from the node class (inherited from RadTreeNode), I have been able to override Expand but the drag and drop stuff I had to control through the tree's own events, not through inheritance and encapsulation. Good old functional programming.

    - jorge
  8. Ali
    Ali avatar
    7 posts
    Member since:
    Aug 2007

    Posted 14 Jan 2008 Link to this post

    Hi again,

    I am using ItemDrag event to control what items are allowed to be dragged, and then i am waiting for the DragEnding event to perform the corresponding action.

    Everything is working fine as long as i am selecting a node and dropping it.

    But if i randomly click on the Tree itself, it is giving the above exceptions.

    So i guess i need to handle the event raised when doing these clicks.

    Any help on that,

    10x,
    Ali
  9. Jorge Delgado-Lopez
    Jorge Delgado-Lopez avatar
    82 posts
    Member since:
    Aug 2007

    Posted 14 Jan 2008 Link to this post

    Hm.. not the same problem as I had, probably same bug though.

    Anyhow, try the dragstarted event instead of itemdrag, see how that goes, works for me.

    - jorge

  10. Ali
    Ali avatar
    7 posts
    Member since:
    Aug 2007

    Posted 14 Jan 2008 Link to this post


    10x for ur fast response.

    But i tried the DragStarted event and still the same problem*-)!

  11. Ali
    Ali avatar
    7 posts
    Member since:
    Aug 2007

    Posted 14 Jan 2008 Link to this post


    Still
  12. Jorge Delgado-Lopez
    Jorge Delgado-Lopez avatar
    82 posts
    Member since:
    Aug 2007

    Posted 14 Jan 2008 Link to this post

    Oh. well the Telerik people will respond you in a day or so. Pretty good support. Good luck!
    - jorge
  13. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 15 Jan 2008 Link to this post

    Hi Ali,

    Thank you for writing.

    There seems to be an issue with drag and drop in RadTreeView. However, the "randomly moving the mouse and clicking" part makes it hard to reproduce, so I will need your help.

    Could you please share the drag and drop related code and settings of properties of RadTreeView. This will allow me to reproduce the issue in a more controlled manner, and help me address any potential issue faster.

    If you have additional questions, please contact us.

    All the best,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  14. Ali
    Ali avatar
    7 posts
    Member since:
    Aug 2007

    Posted 15 Jan 2008 Link to this post

    Hi again,
     
    I tried catching all mouse events but still the same exception.
    The thing is when is the "HandleDragDropCursor()".
     
    To reproduce the error, try creating Nodes and dragging from outside the Node area on the tree to the nodes.
    Or even clicking or scrolling the mouse outside the Node Area but in the tree as well.
     
    Ali,
  15. Ali
    Ali avatar
    7 posts
    Member since:
    Aug 2007

    Posted 15 Jan 2008 Link to this post


    This is the StackTrace

    "   at Telerik.WinControls.UI.RadTreeView.HandleDragDropCursor()\r\n   at Telerik.WinControls.UI.RadTreeView.OnMouseMove(MouseEventArgs e)\r\n   at System.Windows.Forms.Control.WmMouseMove(Message& m)\r\n   at System.Windows.Forms.Control.WndProc(Message& m)\r\n   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n   at Telerik.WinControls.RadControl.WndProc(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.Application.Run(Form mainForm)\r\n   at CWSUtil.Program.Main() in C:\\Workarea\\VS2005\\CWSDesignTool\\CWSUtil\\Program.cs:line 17\r\n   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.ThreadHelper.ThreadStart()"
  16. Ali
    Ali avatar
    7 posts
    Member since:
    Aug 2007

    Posted 15 Jan 2008 Link to this post


    Hi again,

    I guess i found the error.
    I was using ItemDrag and when i wanted to deny a drag drop action i used to write "return" coz i can not use "e.cancel = true".
    It seems that the return calls this Telerik.WinControls.UI.RadTreeView.HandleDragDropCursor which is throwing the exception.

    Instead i only used "DragStartng" event and when i want to abort a drag drop action i use the e.cancel.

    Regards,
    Ali
  17. Jorge Delgado-Lopez
    Jorge Delgado-Lopez avatar
    82 posts
    Member since:
    Aug 2007

    Posted 15 Jan 2008 Link to this post

    Yes, that worked for me too. 

    What I find to be a shame is that it cannot be controlled from the RadTreeNode class. It is a much cleaner way of working with the tree, when overriding methods, such as OnDragStarting for instance. But oh well. It works.
    - jorge 
  18. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 18 Jan 2008 Link to this post

    Hello Ali,

    We could not reproduce the behavior you described. Could you please send us code related to your drag and drop scenario in order to help us reproduce the issue. It will help us track down and address any potential issue faster.

    I'll looking forward to your response.

    Kind regards,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for WinForms is Visual Studio 2017 Ready