Hello Ofer,
Thank you for writing.
When you start a drag operation in
RadTreeView, note that the selected node is currently noticed as
hovered. That is why the screen tip is closed on
MouseUp. You can find below a sample code snippet demonstrating how to hide the screen tip by handling the TreeViewElement.DragDropService.
PreviewDragOver event:
public
Form1()
{
InitializeComponent();
this
.radTreeView1.AllowDragDrop =
true
;
this
.radTreeView1.ScreenTipNeeded += radTreeView1_ScreenTipNeeded;
this
.radTreeView1.TreeViewElement.DragDropService.PreviewDragOver += DragDropService_PreviewDragOver;
}
private
void
DragDropService_PreviewDragOver(
object
sender, RadDragOverEventArgs e)
{
((ComponentBehavior)
this
.radTreeView1.Behavior).GetType().GetProperties(BindingFlags.NonPublic | BindingFlags.Instance);
PropertyInfo barProperty = ((ComponentBehavior)
this
.radTreeView1.Behavior).GetType().GetProperty(
"ScreenPresenter"
,
BindingFlags.NonPublic | BindingFlags.Instance);
Form screenTip = barProperty.GetValue(((ComponentBehavior)
this
.radTreeView1.Behavior),
null
)
as
Form;
screenTip.Hide();
}
RadOffice2007ScreenTipElement screenTip =
new
RadOffice2007ScreenTipElement();
Size size =
new
Size(120, 70);
Padding pad =
new
Padding(2);
private
void
radTreeView1_ScreenTipNeeded(
object
sender, Telerik.WinControls.ScreenTipNeededEventArgs e)
{
TreeNodeElement node = e.Item
as
TreeNodeElement;
if
(node !=
null
)
{
screenTip.MainTextLabel.Image = node.ImageElement.Image;
screenTip.MainTextLabel.TextImageRelation = TextImageRelation.ImageBeforeText;
screenTip.MainTextLabel.Padding = pad;
screenTip.MainTextLabel.Text =
"This is "
+ node.ContentElement.Text;
screenTip.MainTextLabel.Margin =
new
System.Windows.Forms.Padding(10);
screenTip.CaptionLabel.Padding = pad;
screenTip.CaptionLabel.Text = node.ContentElement.Text;
screenTip.EnableCustomSize =
true
;
screenTip.AutoSize =
false
;
screenTip.Size = size;
node.ScreenTip =
this
.screenTip;
}
}
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the
Telerik API Analyzer and share your thoughts.