Hello
I have a simple question. I have trying to implement a simple drag and drop operation from a RadTreeView node to another .NET control (in my case it is a control that represents a model diagram). I have failed so far. Can I do that with the RadTreeView control? I certainly can do with the .NET treeview control.
Thanks for your help.
Regards
Philip
I have a simple question. I have trying to implement a simple drag and drop operation from a RadTreeView node to another .NET control (in my case it is a control that represents a model diagram). I have failed so far. Can I do that with the RadTreeView control? I certainly can do with the .NET treeview control.
Thanks for your help.
Regards
Philip
9 Answers, 1 is accepted
0
Philip
Top achievements
Rank 1
answered on 15 Mar 2010, 02:09 PM
I just wanted to clarify that I am having a problem when the RadTreeView is inside a tool window.
Regards
Philip
Regards
Philip
0
Hi Philip,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Thank you for the question.
We are not sure what approaches you have tried, but you can achieve this easily by using the standard Control member events, namely DragEnter, DragOver etc. You can get the node that you are clicking on via the RadControl.GetElementAtPoint(). This method will return a TreeNodeUI which has an AssociatedRadTreeNode property (the logical node that you need).
If you still find the implementation difficult I would be happy to provide a code snippet.
I am looking forward to your reply.
Kind regards,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Philip
Top achievements
Rank 1
answered on 18 Mar 2010, 07:02 AM
Hi Victor,
Thanks for reply. I have managed to sort it out. It was just me being mixed up about the different events! I did hewever nortice that when I drag and drop a node on a surface, it draws some sort of a label with the name of the node on the surface. It disappears after I refresh the form.
Regards
Philip
Thanks for reply. I have managed to sort it out. It was just me being mixed up about the different events! I did hewever nortice that when I drag and drop a node on a surface, it draws some sort of a label with the name of the node on the surface. It disappears after I refresh the form.
Regards
Philip
0
Hi Philip,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Can you please post a screenshot of this case as we have not experienced such behavior before.
I am looking forward to your reply.
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Christoph
Top achievements
Rank 1
answered on 09 Sep 2010, 10:34 AM
Hello,
Currently I am experiencing the same problem as described above. When dragging from the treeview, the name of the node remains at the point where the mouse is released. In the attached file you find an image which shows the state after dragging.
This is happening when dragging in the treeview itself and when dragging to RadScheduler.
If I leave the active window and return to the one with the RadControls the controls works as expected.
Regards,
Christoph
Currently I am experiencing the same problem as described above. When dragging from the treeview, the name of the node remains at the point where the mouse is released. In the attached file you find an image which shows the state after dragging.
This is happening when dragging in the treeview itself and when dragging to RadScheduler.
If I leave the active window and return to the one with the RadControls the controls works as expected.
Regards,
Christoph
0
Christoph
Top achievements
Rank 1
answered on 09 Sep 2010, 03:27 PM
Hello there,
I managed to solve this problem with the help of this post: http://www.telerik.com/community/forums/winforms/treeview/cancel-selected-node-change-when-drag-and-drop.aspx. I mixed the OLE and Rad events, so dragging never came to an end and the drawn object remained on the screen.
Kind regards,
Christoph
I managed to solve this problem with the help of this post: http://www.telerik.com/community/forums/winforms/treeview/cancel-selected-node-change-when-drag-and-drop.aspx. I mixed the OLE and Rad events, so dragging never came to an end and the drawn object remained on the screen.
Kind regards,
Christoph
0
Hi Christoph,
Thank you for your reply.
I am glad to hear that you found the solution to your issue in our Online Help Documentation.
Should you have any other questions, do not hesitate to contact me.
Regards,
Stefan
the Telerik team
Thank you for your reply.
I am glad to hear that you found the solution to your issue in our Online Help Documentation.
Should you have any other questions, do not hesitate to contact me.
Regards,
Stefan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Christoph
Top achievements
Rank 1
answered on 15 Sep 2010, 08:39 AM
Hello Stefan,
Yes, I have another question I could not solve after a lot of investigation: When using resources on Telerik.WinControls.UI.RadScheduler, how do I find out the resource to which the dragged element is dropped to?
Thank you for your reply!
Regards,
Christoph
Yes, I have another question I could not solve after a lot of investigation: When using resources on Telerik.WinControls.UI.RadScheduler, how do I find out the resource to which the dragged element is dropped to?
Thank you for your reply!
Regards,
Christoph
0
Hello Christoph,
In order to take the correct resource according to when you drop an object from the treeview to the scheduler you should:
1. Convert the position of the cursor to the RadSceduler control:
OR
use the X and Y coordinates from the arguments of the DragDrop event of the Scheduler.
2. Get the SchedulerDayViewGroupedByResourceElement from the RadScheduler
3. With the help of the SchedulerUIHelper class you could take the clicked cell via the cursor position
4. Get the parent SchdulerDayViewElement from the cell
5. For the SchedulerDayViewElement you could easily take the resource that you looking for:
By the way, in grouping mode each day view contains just one resource.
I hope that this will help you. If you have other questions, feel free to write us.
Sincerely yours,
Dobry Zranchev
the Telerik team
In order to take the correct resource according to when you drop an object from the treeview to the scheduler you should:
1. Convert the position of the cursor to the RadSceduler control:
Point point =
this
.radScheduler1.PointToClient(Cursor.Position);
OR
use the X and Y coordinates from the arguments of the DragDrop event of the Scheduler.
2. Get the SchedulerDayViewGroupedByResourceElement from the RadScheduler
SchedulerDayViewGroupedByResourceElement groupedDayViewElement =
this
.radScheduler1.SchedulerElement.ViewElement
as
SchedulerDayViewGroupedByResourceElement;
3. With the help of the SchedulerUIHelper class you could take the clicked cell via the cursor position
SchedulerCellElement cellElement = SchedulerUIHelper.GetCellAtPoint(point, groupedDayViewElement.GetDayViewElements());
4. Get the parent SchdulerDayViewElement from the cell
SchedulerDayViewElement dayViewElement = cellElement.Parent.Parent.Parent.Parent.Parent.Parent
as
SchedulerDayViewElement;
5. For the SchedulerDayViewElement you could easily take the resource that you looking for:
dayViewElement.View.GetResources()[0]
By the way, in grouping mode each day view contains just one resource.
I hope that this will help you. If you have other questions, feel free to write us.
Sincerely yours,
Dobry Zranchev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items