To reproduce:
- Open the attached project.
- Scroll to the right.
- Drag a node.
- The DropHint line is outside the window.
Workaround:
class CustomTreeView : RadTreeView
{
//Replace the default element with the custom one
protected override RadTreeViewElement CreateTreeViewElement()
{
return new CustomTreeViewElement();
}
//Enable theming for the control
public override string ThemeClassName
{
get
{
return typeof(RadTreeView).FullName;
}
}
}
class CustomTreeViewElement : RadTreeViewElement
{
//Enable themeing for the element
protected override Type ThemeEffectiveType
{
get
{
return typeof(RadTreeViewElement);
}
}
//Replace the default drag drop service with the custom one
protected override TreeViewDragDropService CreateDragDropService()
{
return new MyDragDropService(this);
}
}
class MyDragDropService : TreeViewDragDropService
{
public MyDragDropService(RadTreeViewElement owner)
: base(owner)
{ }
protected override void UpdateHintPosition(Point mousePosition)
{
base.UpdateHintPosition(mousePosition);
RadLayeredWindow dropHint =typeof(TreeViewDragDropService).GetField("dropHintWindow", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(this) as RadLayeredWindow;
if (dropHint != null)
{
TreeNodeElement nodeElement = this.DropTarget as TreeNodeElement;
dropHint.Location = new Point (nodeElement.ElementTree.Control.PointToScreen(Point.Empty).X, dropHint.Location.Y);
}
}
}