Hi,
I'm creating an application that will allow users to drag and drop files from Windows explorer into a RadTreeView. I have been unable to highlight a node as a drop target when a file is dragged over it. Is this possible?
Ideally I would like to determine which node the user is hovering over when dragging the file, hightlight the node and change the drop icon to either an allow or disallow icon depending on the node tag.
Many thanks,
Joe
I'm creating an application that will allow users to drag and drop files from Windows explorer into a RadTreeView. I have been unable to highlight a node as a drop target when a file is dragged over it. Is this possible?
Ideally I would like to determine which node the user is hovering over when dragging the file, hightlight the node and change the drop icon to either an allow or disallow icon depending on the node tag.
Many thanks,
Joe
5 Answers, 1 is accepted
0
Hello Joe,
Please note however that you will have to revert the border color to the previous value when the mouse moves over a new node. Write again if you need further assistance.
Regards,
Victor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You can determine which node is under your cursor with the following MouseMove handler:
private
void
radTreeView1_MouseMove(
object
sender, MouseEventArgs e)
{
RadElement elementAtPoint = radTreeView1.ElementTree.GetElementAtPoint(e.Location);
if
(elementAtPoint
is
TreeNodeUI)
{
TreeNodeUI nodeUI = (elementAtPoint
as
TreeNodeUI);
nodeUI.BorderColor = Color.Red;
RadTreeNode node = nodeUI.AssociatedTreeNode;
// Handle conditions based on node.Tag.
}
}
Please note however that you will have to revert the border color to the previous value when the mouse moves over a new node. Write again if you need further assistance.
Regards,
Victor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Joe
Top achievements
Rank 1
answered on 23 Nov 2009, 10:21 AM
Hi Victor,
Thanks for the response.
I would like to mimic/fake a node mouseover in order to highlight the node in exactly the same way it is highlighted when a use moves the mouse over a tree node. Is this possible?
Thanks,
Joe
Thanks for the response.
I would like to mimic/fake a node mouseover in order to highlight the node in exactly the same way it is highlighted when a use moves the mouse over a tree node. Is this possible?
Thanks,
Joe
0
Hello Joe,
Please note that these settings are applicable to TreeNodeUI type, not RadTreeNode. Also these are the settings from the ControlDefault theme. If you are using a different theme and you would like to determine the settings you can do so with the Visual Style Builder tool or with the aid of RadControlSpy tool.
Thank you for the question. This is possible, you just need to set the appropriate settings. Currently, for a hovered node, they are:
nodeUI.BackColor = Color.FromArgb(255, 231, 162);
nodeUI.NumberOfColors = 1;
nodeUI.BorderColor = Color.FromArgb(255, 189, 105);
Please note that these settings are applicable to TreeNodeUI type, not RadTreeNode. Also these are the settings from the ControlDefault theme. If you are using a different theme and you would like to determine the settings you can do so with the Visual Style Builder tool or with the aid of RadControlSpy tool.
Please write again if you need further assistance.
Best wishes,
Victor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Best wishes,
Victor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Joe
Top achievements
Rank 1
answered on 23 Nov 2009, 03:14 PM
Hi Victor,
That works great, thank you :)
Joe
That works great, thank you :)
Joe
0
Accepted
You are welcome, Joe! Feel free to mark this thread as answered.
If you need further assistance we are ready to assist you.
Sincerely yours,
Victor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Sincerely yours,
Victor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.