Completed
Last Updated: 12 Jun 2014 20:26 by ADMIN
To reproduce : add a RadTreeView with several nodes and use the following code snippet:

this.radTreeView1.AllowDragDrop = true;
this.TopMost = true;

Note that dragging a node will no longer display the "DropHint" line.

Workaround:

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

    protected override void UpdateHintPosition(Point mousePosition)
    {
        FieldInfo fi = typeof(TreeViewDragDropService).GetField("dropHintWindow",
            BindingFlags.NonPublic | BindingFlags.Instance);
       
        RadLayeredWindow window = fi.GetValue(this) as RadLayeredWindow;
        window.TopMost = true;
        base.UpdateHintPosition(mousePosition);
    }
}

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 CustomDragDropService(this);
    }
}

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;
        }
    }
}
Completed
Last Updated: 02 Jun 2014 12:47 by ADMIN
To reproduce:
- Add RadTreeView to a blank form.
- Set its AllowDragDrop and AllowDefaultContextMenu properties to true.
- Clear the menu items in the  ContextMenuOpening event.
- You will notice that the Copy, Cut and Paste items are not removed.

Workaround:
 void radTreeView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.TreeViewContextMenuOpeningEventArgs e)
{
   
    e.Menu.DropDownOpened -= Menu_DropDownOpened; 
    e.Menu.DropDownOpened += Menu_DropDownOpened; 
}

void Menu_DropDownOpened(object sender, EventArgs e)
{
    TreeViewDefaultContextMenu Menu = sender as TreeViewDefaultContextMenu;

    for (int i = Menu.Items.Count - 1; i >= 0; i--)
    {
        if (Menu.Items[i].Name == "Copy" || Menu.Items[i].Name == "Cut" || Menu.Items[i].Name == "Paste")
        {
            Menu.Items.Remove(Menu.Items[i]);
        }
    }
}
Declined
Last Updated: 19 May 2014 08:59 by ADMIN
Created by: thad
Comments: 1
Category: TreeView
Type: Bug Report
0
The disabling of the scroll bars is broke as shit.

I have tried 

    rtvDrainage.HorizontalScroll.Visible = false;
          rtvDrainage.HorizontalScroll.Maximum = 0;
          rtvDrainage.HorizontalScroll.Enabled = false;
          rtvDrainage.AutoScroll = false;
          rtvDrainage.EnableDeferredScrolling = false;
          rtvDrainage.EnableKineticScrolling = false;

          
          rtvDrainage.HScrollBar.Maximum = 0;
          rtvDrainage.HScrollBar.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;

NOTHING stops this damn thing from showing up (i put this in both the load and in a button to hit after loading)

2 hours wasted trying to make a scroll bar not show up.........
Unplanned
Last Updated: 30 Mar 2016 13:33 by ADMIN
To reproduce:

Use the following code on an empty RadTreeView: 

this.TreeView.AddNodeByPath("General\\Billing\\February\\Report.txt");

You will see that the Report.txt node will be added to the Root node

Workaround:

Use the following method:

private RadTreeNodeCollection AddNode(string path)
{
    if (path == String.Empty)
        return this.TreeView.Nodes;


    string node = Path.GetFileName(path);
    RadTreeNodeCollection parent = AddNode(Path.GetDirectoryName(path));


    if (parent.Contains(node))
        return parent[node].Nodes;
    else
        return parent.Add(node).Nodes;
}

Completed
Last Updated: 08 May 2014 11:57 by ADMIN
Add a RadTreeView with several hierarchy levels. Initially all nodes are collapsed. When you collapse each child node deeper in the hierarchy, use the following code snippet:

public Form1()
{
    InitializeComponent();

    radTreeView1.CollapseAll();
    radTreeView1.TreeViewElement.AutoScrollOnClick = false;
}

private void radTreeView1_NodeExpandedChanged(object sender, RadTreeViewEventArgs e)
        {
            if (e.Node.Expanded)
            {
                e.Node.LastNode.EnsureVisible();
                radTreeView1.BringIntoView(e.Node.LastNode);
            }
        }
		
The last child node is visible, regarding the height, however, the entire node is not visible, regarding the width.

Workaround: use RadTreeView.MouseUp event instead.

private void radTreeView1_MouseUp(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Left)
    {
        TreeNodeExpanderItem expander = radTreeView1.ElementTree.GetElementAtPoint(e.Location) as TreeNodeExpanderItem;
        if (expander != null && expander.Expanded && expander.NodeElement.Data != null)
        {
            radTreeView1.BringIntoView(expander.NodeElement.Data.LastNode);
        }
    }
}

Completed
Last Updated: 08 May 2014 12:11 by ADMIN
To reproduce:
- Add treeview to a form and set its AutoScrollOnClick property to false.
- click a node that is not entirely visible with the right mouse button.
- You will notice that the view is auto scrolled.
Completed
Last Updated: 18 Nov 2014 11:05 by ADMIN
To reproduce
- Add RadTreeView with some nodes to a blank form.
- Set the MultiSelect property to true.
- Select\Deselect a node with code.
 
Resolution: 
The SelectedNodeChanged event should not be fired when selected/deselected the node programmatically. We added a new event SelectedNodesChanged which is fired when the SelectedNodes collection changes.
Completed
Last Updated: 01 Oct 2014 13:03 by ADMIN
To reproduce: 


protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);


    radTreeView1 = new RadTreeView();
    radTreeView1.Parent = this;


    for (int i = 0; i < 5; i++)
    {
        RadTreeNode n1 = new RadTreeNode("Node" + i);
        this.radTreeView1.Nodes.Add(n1);
        if (i % 2 == 0)
        {
            for (int j = 0; j < 2; j++)
            {
                RadTreeNode n2 = new RadTreeNode("Node" + i + "." + j);
                n1.Nodes.Add(n2);


                if (j % 2 == 0)
                {
                    for (int k = 0; k < 2; k++)
                    {
                        RadTreeNode n3 = new RadTreeNode("Node" + i + "." + j + "." + k);
                        n2.Nodes.Add(n3);
                    }
                }
            }
        }
    }
    radTreeView1.ShowRootLines = false;
    radTreeView1.ShowLines = false;
}


Workaround:

void radTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
{
    if (radTreeView1.ShowLines == false)
    {
        if (e.NodeElement.LinesContainerElement.Children.Count > 0)
        {
            TreeNodeLineElement lineElement = (TreeNodeLineElement)e.NodeElement.LinesContainerElement.Children[0];
            lineElement.Visibility = ElementVisibility.Collapsed;
        }
    }
}
Completed
Last Updated: 01 Oct 2014 13:03 by ADMIN
To reproduce:

protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);


    radTreeView1 = new RadTreeView();
    radTreeView1.Parent = this;


    for (int i = 0; i < 5; i++)
    {
        RadTreeNode n1 = new RadTreeNode("Node" + i);
        this.radTreeView1.Nodes.Add(n1);
        if (i % 2 == 0)
        {
            for (int j = 0; j < 2; j++)
            {
                RadTreeNode n2 = new RadTreeNode("Node" + i + "." + j);
                n1.Nodes.Add(n2);


                if (j % 2 == 0)
                {
                    for (int k = 0; k < 2; k++)
                    {
                        RadTreeNode n3 = new RadTreeNode("Node" + i + "." + j + "." + k);
                        n2.Nodes.Add(n3);
                    }
                }
            }
        }
    }
    radTreeView1.ShowRootLines = true;
    radTreeView1.ShowExpandCollapse = false;
    radTreeView1.ShowLines = true;
}


WORKAROUND: 
        void radTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
        {
            if (radTreeView1.ShowExpandCollapse == false && radTreeView1.ShowRootLines == true)
            {
                if (e.Node.Parent == null && e.Node.Nodes.Count >0)
                {
                    TreeNodeLineElement lineElement = (TreeNodeLineElement)e.NodeElement.LinesContainerElement.Children[0];
                    lineElement.Visibility = ElementVisibility.Visible;
                    if (e.Node.Index==0)
                    {
                        lineElement.Type = TreeNodeLineElement.LinkType.RightTopAngleShape;
                    }
                    else if (e.Node.Index == radTreeView1.Nodes.Count -1)
                    {
                        lineElement.Type = TreeNodeLineElement.LinkType.RightBottomAngleShape;
                    }
                }
            }
        }
Unplanned
Last Updated: 30 Mar 2016 13:33 by ADMIN
To reproduce:


Add nodes to RadTreeView with at least 3 levels hierarchy. Set some of the last level nodes Visible property to false. Start the application. Expand some nodes and scroll. You will notice that the last item will change sometimes.


Workaround:
Set this.radTreeView1.TreeViewElement.AllowArbitraryItemHeight = true;
Use ItemHeight = 1, instead of Visible = false
Completed
Last Updated: 07 Sep 2016 15:12 by ADMIN
Start dragging a node and scroll using the mouse wheel. While scrolling, drop the node. 
Completed
Last Updated: 20 Feb 2014 15:26 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: TreeView
Type: Bug Report
0
To reproduce:
-add RadTreeView and RadButton:
-use the following code:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        List<Distributor> distributors = new List<Distributor>()
        {
            new Distributor(432,"Distributor 1"),
            new Distributor(454,"Distributor 2"),
            new Distributor(438,"Distributor 3"),
            new Distributor(455,"Distributor 4")
        };

        List<Distributor> distributors2 = new List<Distributor>()
        {
            new Distributor(486,"Distributor 5"),
            new Distributor(487,"Distributor 6"),
            new Distributor(498,"Distributor 7"),
            new Distributor(475,"Distributor 8")
        };

        List<Product> products = new List<Product>();
        products.Add(new Product(567, "Bicycle", 5, distributors));
        products.Add(new Product(456, "Car", 5000,distributors2));
        products.Add(new Product(789, "Bike", 1500,null));

        BindingList<Category> categories = new BindingList<Category>();
        categories.Add(new Category("Bikes", products));
        categories.Add(new Category("Accessories", null));
        categories.Add(new Category("Clothing", null));

        radTreeView1.DataSource = categories;
        if ((radTreeView1.DataSource as BindingList<Category>).Count > 0)
        {
            radTreeView1.DisplayMember = "Name\\Description\\Name";
            radTreeView1.ChildMember = "Categories\\Products\\Distributors";   
        }
        
    }

    private void radButton1_Click(object sender, EventArgs e)
    {
        BindingList<Category> categories = radTreeView1.DataSource as BindingList<Category>;
        categories.Clear();
    }
}

public class Distributor
{
    private int _id;
    private string _name;

    public Distributor(int id, string name)
        {
            this._id = id;
            this._name = name;
        }

    public int Id
        {
            get
            {
                return this._id;
            }
            set
            {
                this._id = value;
            }
        }

    public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                this._name = value;
            }
        }
}

public class Product
{
    private int _id;
    private string _description;
    private float _price;
    private List<Distributor> _distributors;

    public List<Distributor> Distributors
        {
            get
            {
                return this._distributors;
            }
            set
            {
                this._distributors = value;
            }
        }

    public int ID
        {
            get
            {
                return _id;
            }
            set
            {
                _id = value;
            }
        }

    public string Description
        {
            get
            {
                return _description;
            }
            set
            {
                _description = value;
            }
        }

    public float Price
        {
            get
            {
                return _price;
            }
            set
            {
                _price = value;
            }
        }

    public Product(int id, string description, float price, List<Distributor> distributors)
    {
        _id = id;
        _description = description;
        _price = price;
        _distributors = distributors;
    }
}

public class Category
{
    public Category(string name, List<Product> products)
    {
        _name = name;
        _products = products;
    }

    private List<Product> _products;
    private string _name;

    public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
            }
        }

    public List<Product> Products
        {
            get
            {
                return _products;
            }
            set
            {
                _products = value;
            }
        }
}

When you click the button, ArgumentOutOfRangeException is thrown.

Workaround: instead of clearing the BindingList, remove each list item one by one:
while (categories.Count>0)
{
    categories.RemoveAt(0);
}
Unplanned
Last Updated: 30 Mar 2016 13:29 by ADMIN
To reproduce:
Add a RadTreeView and a Timer(from the Windows.Forms namespace). Set the timer's interval to some short duration and add nodes to tree on its tick event. Scroll the thumb while the timer is ticking. At some point you will notice that the scrollbar's maximum value is not correct.

Workaround:
Do not add nodes while scrolling:
List<string> cachedValues = new List<string>();
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer() { Interval = 100 };

void radTreeView1_MouseCaptureChanged(object sender, EventArgs e)
{
    timer.Start();
}

void timer_Tick(object sender, EventArgs e)
{
    timer.Stop();
    if (this.cachedValues.Count > 0 && !radTreeView1.TreeViewElement.Scroller.Scrollbar.ThumbElement.Capture)
    {
        foreach (string value in this.cachedValues)
        {
            root.Nodes.Add(value);
        }

        cachedValues.Clear();
    }
}

private void timerUpdateNodes_Tick(object sender, EventArgs e)
{
    for (int i = 0; i < 10; ++i)
    {
        if (random.NextDouble() < .2)
        {
            if (radTreeView1.TreeViewElement.Scroller.Scrollbar.ThumbElement.Capture)
            {
                cachedValues.Add("Node");
            }
            else
            {
                root.Nodes.Add("Node");
            }
        }
    }
}
Completed
Last Updated: 20 Feb 2014 15:27 by ADMIN
Workaround:
Instead of {RadTreeNode}.Nodes.Clear(), use 

 while ({RadTreeNode}.Nodes.Count>0)
          {
              {RadTreeNode}.Nodes.RemoveAt(0);
          }
Completed
Last Updated: 20 Mar 2014 11:23 by ADMIN
To reproduce:
- Add a RadTreeView which have parent and child nodes to a form.
- Expand nodes until the both scrollbars are simultaneously shown.
- You will notice that you cannot scroll to the last item.

Workaround:
- Subscribe to the following ScrollerUpdated event handler:

void Scroller_ScrollerUpdated(object sender, EventArgs e)
{
radTreeView1.TreeViewElement.InvalidateMeasure();

}

- You can subscribe to this event with the following line of code:
radTreeView1.TreeViewElement.Scroller.ScrollerUpdated += Scroller_ScrollerUpdated;
Completed
Last Updated: 12 Mar 2014 09:48 by ADMIN
To reproduce: 
Add a RadTreeView to a form and use the following code:
private List<EntityA> entities = new List<EntityA>(); public Form1() { InitializeComponent(); radTreeView1.TriStateMode = true; entities = new List<EntityA>(); for (int i = 0; i < 10; i++) { var newEntityI = new EntityA(i.ToString()); for (int j = 0; j < 100; j++) { var newEntityJ = new EntityB(j.ToString()); for (int k = 0; k < 1000; k++) { var newEntityK = new EntityC(k.ToString()); newEntityJ.Entities.Add(newEntityK); } newEntityI.Entities.Add(newEntityJ); } entities.Add(newEntityI); } } private void checkBox1_CheckedChanged(object sender, EventArgs e) { foreach (var node in radTreeView1.Nodes) { node.Checked = checkBox1.Checked; } } private void radTreeView1_NodesNeeded(object sender, NodesNeededEventArgs e) { if (e.Parent == null) { foreach (var entity in entities) { e.Nodes.Add(new RadTreeNode(entity.Name, false) { CheckState = ToggleState.Off, Tag = entity }); } } else if (e.Parent.Tag is EntityA) { var currentEntity = e.Parent.Tag as EntityA; foreach (var entity in currentEntity.Entities) { e.Nodes.Add(new RadTreeNode(entity.Name, false) { CheckState = e.Parent.CheckState, Tag = entity }); } } else if (e.Parent.Tag is EntityB) { var currentEntity = e.Parent.Tag as EntityB; foreach (var entity in currentEntity.Entities) { e.Nodes.Add(new RadTreeNode(entity.Name, false) { CheckState = e.Parent.CheckState, Tag = entity }); } } else if (e.Parent.Tag is EntityC) { } } 
Put a breakpoint in the last If statement, you will notice that the breakpoint is being hit, while it is not if the TrieStateMode is set to false 

Workaround: 
Use the following custom RadTreeNode: 
public class MyTreeNode : RadTreeNode { private FieldInfo triStateField; public MyTreeNode() : base() { } public MyTreeNode(string text) : base(text) { } public MyTreeNode(string text, RadTreeNode[] children) : base(text, children) { } public MyTreeNode(string text, bool expanded) : base(text, expanded) { } public MyTreeNode(string text, Image image) : base(text, image) { } public MyTreeNode(string text, Image image, bool expanded) : base(text, image, expanded) { } public override ToggleState CheckState { get { return base.CheckState; } set { bool set = false; if (this.TreeViewElement != null && this.TreeViewElement.TriStateMode) { if (this.triStateField == null) { this.triStateField = typeof(RadTreeViewElement).GetField("triStateMode", BindingFlags.Instance | BindingFlags.NonPublic); } triStateField.SetValue(this.TreeViewElement, false); set = true; } base.CheckState = value; if (set) { this.triStateField.SetValue(this.TreeViewElement, true); } } } }

Completed
Last Updated: 31 Mar 2014 10:27 by ADMIN
Add e.Action in SelectedNodeChanging similar to the one in the standard TreeView.BeforeSelect event which indicates what caused the event - mouse click, key pressed, or other
Completed
Last Updated: 05 Mar 2014 08:33 by ADMIN
ADMIN
Created by: Georgi I. Georgiev
Comments: 0
Category: TreeView
Type: Bug Report
0
To reproduce: Add a RadTreeView with hierarchical data. Select a node with hierarchy level > 0. Call the Clear method of the Nodes collection. Refill the tree, drag and drop a node, you will see that two nodes will be dropped since the previous node's Selected property is set to true. 

Workaround: private void DetachAllNodes(RadTreeNode parent) { this.CleanNode(parent); foreach (RadTreeNode node in parent.Nodes) { this.DetachAllNodes(node); } } private void CleanNode(RadTreeNode node) { node.Current = false; node.Selected = false; } foreach (RadTreeNode node in tree.Nodes) { this.DetachAllNodes(node); } tree.Nodes.Clear();
Completed
Last Updated: 05 Nov 2013 02:31 by ADMIN
Workaround:
this.radTreeView1.SelectedNode = null;
Completed
Last Updated: 22 Oct 2013 11:54 by ADMIN
To reproduce: this issue is reproducible under Windows8 OS only
-add RadTreeView from the Toolbox to the Form and add several tree nodes at design time;
-add RadContextMenu from the Toolbox and add several items at design time;
Use the following code:
public Form1()
{
    InitializeComponent();

    this.radTreeView1.RadContextMenu = this.radContextMenu1;
}
-run the application;
-select a tree node;
-right mouse click over the node to show the context menu; As a result the main form looses focus and you are unable to click anywhere outside the RadTreeView.
This issue is inconstant and it is not appearing every time.

Workaround: use ContextMenu property instead:
public Form1()
{
    InitializeComponent();

    ContextMenu menu = new ContextMenu();

    foreach (var item in radContextMenu1.Items)
    {
        menu.MenuItems.Add(new MenuItem(item.Text));
    }

    this.radTreeView1.ContextMenu = menu;
    // this.radTreeView1.RadContextMenu = this.radContextMenu1;
}