Completed
Last Updated: 15 Aug 2017 10:29 by ADMIN
ADMIN
Hristo
Created on: 27 Apr 2017 13:17
Category: TreeView
Type: Bug Report
1
FIX. RadTreeView - drag and drop does not work when the tree is bound to self relating data
How to reproduce: check the attached project

Workaround: create a custom TreeViewDragDropService
class CustomTreeViewElement : RadTreeViewElement
{
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadTreeViewElement);
        }
    }

    protected override TreeViewDragDropService CreateDragDropService()
    {
        return new CustomDragDropService(this);
    }
}

class CustomTreeView : RadTreeView
{
    protected override RadTreeViewElement CreateTreeViewElement()
    {
        return new CustomTreeViewElement();
    }
 
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadTreeView).FullName;
        }
    }
}

class CustomDragDropService : TreeViewDragDropService
{
    public CustomDragDropService(RadTreeViewElement owner) 
        : base(owner)
    { }

    protected override bool CancelPreviewDragDrop(RadDropEventArgs e)
    {
        return false;
    }
}

Attached Files:
0 comments