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

Drag and drop exceptions

16 Answers 211 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
superold
Top achievements
Rank 1
superold asked on 28 Aug 2007, 03:20 PM
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




16 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 29 Aug 2007, 08:12 AM
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
0
j0rge
Top achievements
Rank 1
answered on 07 Sep 2007, 04:22 PM
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
0
Jordan
Telerik team
answered on 11 Sep 2007, 02:18 PM
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
0
Ali
Top achievements
Rank 1
answered on 14 Jan 2008, 09:36 AM
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
0
superold
Top achievements
Rank 1
answered on 14 Jan 2008, 12:56 PM
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
0
Ali
Top achievements
Rank 1
answered on 14 Jan 2008, 01:01 PM
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
0
superold
Top achievements
Rank 1
answered on 14 Jan 2008, 01:22 PM
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

0
Ali
Top achievements
Rank 1
answered on 14 Jan 2008, 01:29 PM

10x for ur fast response.

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

0
Ali
Top achievements
Rank 1
answered on 14 Jan 2008, 01:30 PM

Still
0
superold
Top achievements
Rank 1
answered on 14 Jan 2008, 01:31 PM
Oh. well the Telerik people will respond you in a day or so. Pretty good support. Good luck!
- jorge
0
Jordan
Telerik team
answered on 15 Jan 2008, 08:54 AM
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
0
Ali
Top achievements
Rank 1
answered on 15 Jan 2008, 09:28 AM
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,
0
Ali
Top achievements
Rank 1
answered on 15 Jan 2008, 09:36 AM

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()"
0
Ali
Top achievements
Rank 1
answered on 15 Jan 2008, 10:57 AM

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
0
superold
Top achievements
Rank 1
answered on 15 Jan 2008, 11:34 AM
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 
0
Jordan
Telerik team
answered on 18 Jan 2008, 01:12 PM
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
Tags
Treeview
Asked by
superold
Top achievements
Rank 1
Answers by
Jordan
Telerik team
j0rge
Top achievements
Rank 1
Ali
Top achievements
Rank 1
superold
Top achievements
Rank 1
Share this question
or