Hi,
Is there a way to get either the bounds or the client x,y position of a RadTreeNode item so I can point a Tooltip at a tree item? Either that or be able to get the window handle for the tree item so I can use that in the tooltip.Show() method.
Thanks
Paul
Is there a way to get either the bounds or the client x,y position of a RadTreeNode item so I can point a Tooltip at a tree item? Either that or be able to get the window handle for the tree item so I can use that in the tooltip.Show() method.
Thanks
Paul
4 Answers, 1 is accepted
0
Hi AccSys,
Thank you for this question.
In general, you do not have to handle an event and check node coordinates to show a node tooltip in RadTreeView. All you have to do is to set the ShowNodeToolTips property to true (which is by default) and then set the desired tooltip text for every node:
Of course, if you want to handle this manually, you can get the node at given coordinates by using the GetNodeElementAt method:
I hope this helps. If you have any further questions, do not hesitate to ask.
Greetings,
Jack
the Telerik team
Thank you for this question.
In general, you do not have to handle an event and check node coordinates to show a node tooltip in RadTreeView. All you have to do is to set the ShowNodeToolTips property to true (which is by default) and then set the desired tooltip text for every node:
view.Nodes[0].Nodes[0].ToolTipText =
"wewer"
;
view.ShowNodeToolTips =
false
;
Of course, if you want to handle this manually, you can get the node at given coordinates by using the GetNodeElementAt method:
void
view_MouseMove(
object
sender, MouseEventArgs e)
{
TreeNodeElement nodeElement =
this
.radTreeView1.TreeViewElement.GetNodeElementAt(e.Location);
if
(nodeElement !=
null
)
{
//...
}
}
I hope this helps. If you have any further questions, do not hesitate to ask.
Greetings,
Jack
the Telerik team
0
AccSys
Top achievements
Rank 1
answered on 29 Jun 2011, 11:31 AM
Thanks for the response, but this isn't exactly what I want to do. I need to be able to show a Balloon tooltip over a specific node in the treeview as a "Where is my item?" function.
We have various treeviews in numerous PageViews, and I need to "Show" the user where the item is they've selected in a completely unrelated view (in this case a Modal Dialog).
Can the tooltips be shown as Balloons? I don't want the tooltip to appear when the mouse is over a node, otherwise I'd have done what you suggested :)
Paul
We have various treeviews in numerous PageViews, and I need to "Show" the user where the item is they've selected in a completely unrelated view (in this case a Modal Dialog).
Can the tooltips be shown as Balloons? I don't want the tooltip to appear when the mouse is over a node, otherwise I'd have done what you suggested :)
Paul
0
Accepted
Hello Accsys,
Thank you for this clarification. You can show and position the balloon by using the ControlBoundingRectangle property of the desired TreeNodeElement. Please consider the following sample:
In case you need further assistance, I will be glad to help.
Kind regards,
Jack
the Telerik team
Thank you for this clarification. You can show and position the balloon by using the ControlBoundingRectangle property of the desired TreeNodeElement. Please consider the following sample:
ToolTip tip =
new
ToolTip();
bool
tipVisible;
private
void
radButton1_Click(
object
sender, EventArgs e)
{
if
(tipVisible)
{
return
;
}
RadTreeNode node =
this
.radTreeView1.Nodes[0].Nodes[2];
TreeNodeElement element =
this
.radTreeView1.TreeViewElement.GetElement(node);
if
(element !=
null
)
{
Point location = element.ContentElement.ControlBoundingRectangle.Location;
tip.IsBalloon =
true
;
tip.SetToolTip(
this
.radTreeView1,
"Caption"
);
tip.Show(
"I am a tooltip"
,
this
.radTreeView1, location);
tipVisible =
true
;
}
}
In case you need further assistance, I will be glad to help.
Kind regards,
Jack
the Telerik team
Registration for Q2 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting July 18th and book your seat for a walk through all the exciting stuff we ship with the new release!
0
AccSys
Top achievements
Rank 1
answered on 04 Jul 2011, 10:58 AM
Thanks, that's sorted it. As a side note for anyone else doing the same, make sure the toolTip.Show() method is called twice for a Balloon tooltip to show correctly.