Approved
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;
}

Approved
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
Approved
Last Updated: 30 Mar 2016 13:33 by ADMIN
If you have a node with a very long text that requires horizontal scrollbar and at the same time you have a many nodes which requires a vertical scrollbar in some border cases the long text of the node is cut off (with ellipsis).
Approved
Last Updated: 30 Mar 2016 13:33 by ADMIN
The Enabled property cannot be set in PropertyBuild if the RadTreeView is already data-binded via Property builder

Workaround:

Set the property at run-time.
Approved
Last Updated: 30 Mar 2016 13:32 by ADMIN
Workaround: 
private void radTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
{
    e.NodeElement.ContentElement.TextAlignment = ContentAlignment.MiddleCenter;
}
Approved
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");
            }
        }
    }
}
Approved
Last Updated: 30 Mar 2016 13:29 by Svetlin
Copy and paste in RadTreeView does not copies all properties of RadTreeNode.
Approved
Last Updated: 30 Mar 2016 13:28 by Svetlin
The child nodes are aligned to the root nodes when ShowRootLines property is set to false.
Approved
Last Updated: 30 Mar 2016 13:22 by ADMIN
To reproduce:
  radTreeView1.Filter = "new";
            radTreeView1.Nodes.Add("new Node");
            for (int i = 0; i < 1000; i++)
            {
                radTreeView1.Nodes.Add(new RadTreeNode("test"));
            }

Workaround:
            radTreeView1.TreeViewElement.Update(RadTreeViewElement.UpdateActions.Reset);
Completed
Last Updated: 08 Mar 2016 06:52 by ADMIN
To reproduce:
- Bind to object-relational data
- Add node via the context menu.
- The DataBoundItem in the NodeAdding and NodeAdded events is null.

Workaround:
- Add the node in the code behind:
private void RadTreeView1_NodeAdding(object sender, RadTreeViewCancelEventArgs e)
{
    e.Cancel = true;
    RadTreeNode node = radTreeView1.SelectedNode;
    if (node.Level == 0)
    {
        data.Add(new MyParentClass() { Text = "test" });
    }

}
Completed
Last Updated: 22 Feb 2016 07:59 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();
    this.radTreeView1.LazyMode = true; 
    this.radTreeView1.NodesNeeded+=radTreeView1_NodesNeeded;
}

private void radTreeView1_NodesNeeded(object sender, Telerik.WinControls.UI.NodesNeededEventArgs e)
{
    
}

Workaround: set the AllowArbitraryItemHeight property to true.
Completed
Last Updated: 10 Feb 2016 13:13 by ADMIN
To reproduce:
1) Create a Windows Forms project.
2) Add a RadTreeView control.
3) Set the KeyboardSearchEnabled property to true.
4) Run the application and click in the tree (just to make sure it has the focus).
5) Using the keyboard, press a letter key.
6) Minimize the application.

The same exception occurs if there are no selected nodes.

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

        set
        {
            base.ThemeClassName = value;
        }
    }
}
class MyTreeViewElement : RadTreeViewElement
{
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadTreeViewElement);
        }
    }
    protected override RadTreeNode GetFirstMatch(string searchCriteria, RadTreeNodeCollection nodes)
    {
        if(this.SelectedNode == null && this.Items == null)
        {
            return null;
        }
        return base.GetFirstMatch(searchCriteria, nodes);
    }
}

Declined
Last Updated: 19 Jan 2016 13:18 by ADMIN
An exception is thrown when changing the selection mode from Single to MultiSelect and then scrolling and selecting nodes.
Completed
Last Updated: 19 Jan 2016 10:45 by ADMIN
When you open the last node for edit programmatically, either an exception is thrown or the editor is not opened.

Steps to reproduce:

1. Drag a RadTreeView from Toolbox and drop it onto the form.
2. Set the size of RadTreeView at design time to Size(354, 248).
3. Add a RadButton.
4. Use the following code:
public Form1()
{
    InitializeComponent(); 
    radTreeView1.AllowEdit = true; 
    radTreeView1.Nodes.Add("Root");
    for (int i = 0; i < 20; i++)
    {
        radTreeView1.Nodes[0].Nodes.Add("Test" + i.ToString());
    }
}

private void radButton1_Click(object sender, EventArgs e)
{
    RadTreeNode node = new RadTreeNode("Demo" + radTreeView1.Nodes[0].Nodes.Count.ToString());
    radTreeView1.Nodes[0].Nodes.Add(node);
    node.BeginEdit();
}

5. Click the button.
6. Collapse the root node.
7. Click the button again.



Workaround:

        private void button1_Click(object sender, EventArgs e)
        {
            RadTreeNode node = new RadTreeNode("Demo" + radTreeView1.Nodes[0].Nodes.Count.ToString());
            radTreeView1.Nodes[0].Nodes.Add(node);
            this.radTreeView1.TreeViewElement.Update(RadTreeViewElement.UpdateActions.Reset);
            node.Parent.Expanded = true;
            ((MyTreeViewElement)this.radTreeView1.TreeViewElement).SuspendEndEdit = true;
            node.BeginEdit();
            ((MyTreeViewElement)this.radTreeView1.TreeViewElement).SuspendEndEdit = false;
        } 

    public class MyTreeView : RadTreeView
    {
        protected override RadTreeViewElement CreateTreeViewElement()
        {
            return new MyTreeViewElement();
        }

        public override string ThemeClassName
        {
            get
            {
                return typeof(RadTreeView).FullName;
            }
            set
            {
            }
        }
    }

    public class MyTreeViewElement : RadTreeViewElement
    {
        public bool SuspendEndEdit = false;

        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(RadTreeViewElement);
            }
        }

        protected override bool EndEditCore(bool commitChanges)
        {
            if (SuspendEndEdit)
            {
                return false;
            }

            return base.EndEditCore(commitChanges);
        }
    }
Completed
Last Updated: 16 Dec 2015 09:03 by ADMIN
To reproduce: use the following code snippet and perform the illustrated steps on the attached gif file:

public Form1()
{
    InitializeComponent();

    for (int i = 0; i < 5; i++)
    {
        this.radTreeView1.Nodes.Add("Node" + i);
    }

    this.radTreeView1.NodeRemoving += radTreeView1_NodeRemoving;

    this.radTreeView1.AllowRemove = true;
    this.radTreeView1.AllowDefaultContextMenu = true;
}

private void radTreeView1_NodeRemoving(object sender, Telerik.WinControls.UI.RadTreeViewCancelEventArgs e)
{
    DialogResult result = RadMessageBox.Show(String.Format("Do you really want to remove the node '{0}'?", e.Node.Text),
        "Question", System.Windows.Forms.MessageBoxButtons.YesNo, RadMessageIcon.Question);

    if (result != System.Windows.Forms.DialogResult.Yes)
    {
        e.Cancel = true;
    }
}
Declined
Last Updated: 11 Nov 2015 15:05 by ADMIN
To reproduce:
public Form1()
{
    InitializeComponent(); 
    this.radTreeView1.NodesNeeded+=radTreeView1_NodesNeeded;
}

private void radTreeView1_NodesNeeded(object sender, Telerik.WinControls.UI.NodesNeededEventArgs e)
{
    Console.WriteLine("NodesNeeded"); 
}

As a result StackOverFlowException is thrown.

Workaround: Do not subscribe to the NodesNeeded event if the LazyMode property is set to false.
Completed
Last Updated: 05 Nov 2015 12:22 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: TreeView
Type: Bug Report
0
To reproduce:

public BlankTreeView()
{
    InitializeComponent();
    RadContextMenu menu = new RadContextMenu();
    RadMenuItem addItem = new RadMenuItem("Add");
    addItem.Click += addItem_Click;
    menu.Items.Add(addItem);
    this.radTreeView1.RadContextMenu = menu;
    
    BindingList<ParentObject> items = new BindingList<ParentObject>();
    for (int i = 0; i < 3; i++)
    {
        BindingList<ChildObject> subItems = new BindingList<ChildObject>();
        for (int j = 0; j < 10; j++)
        {
            subItems.Add(new ChildObject(j,"SubNode" + i + "." + j));
        }

        items.Add(new ParentObject(i ,"Node" + i,subItems));
    }

    this.radTreeView1.DataSource = items;
    this.radTreeView1.DisplayMember = "Title\\Description";
    this.radTreeView1.ChildMember = "ParentObject\\Children";
}

private void addItem_Click(object sender, EventArgs e)
{
    if (this.radTreeView1.SelectedNode != null)
    {
        if (this.radTreeView1.SelectedNode.Level == 0)
        {
            Random rand = new Random(); 
            ParentObject dataItem = this.radTreeView1.SelectedNode.DataBoundItem as ParentObject;
            if (dataItem != null)
            {
                dataItem.Children.Add(new ChildObject(rand.Next(0, 100),"New Node"));
            } 
        }
    }
}

public class ParentObject: INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void OnPropertyChanged(string propertyName)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
    
    private int id;
    private string title;
    private BindingList<ChildObject> children;

    public int ID
    {
        get
        {
            return this.id;
        }
        set
        {
            this.id = value;
            OnPropertyChanged("ID");
        }
    }

    public string Title
    {
        get
        {
            return this.title;
        }
        set
        {
            this.title = value;
            OnPropertyChanged("Title");
        }
    }

    public BindingList<ChildObject> Children
    {
        get
        {
            return this.children;
        }
        set
        {
            this.children = value;
            OnPropertyChanged("Children");
        }
    }

    public ParentObject(int iD, string title, BindingList<ChildObject> children)
    {
        this.ID = iD;
        this.Title = title;
        this.Children = children;
    }
}

public class ChildObject: INotifyPropertyChanged
{ 
    public event PropertyChangedEventHandler PropertyChanged;

    private int id;
    private string description;

    public int ID
    {
        get
        {
            return this.id;
        }
        set
        {
            this.id = value;
            OnPropertyChanged("ID");
        }
    }

    public string Description
    {
        get
        {
            return this.description;
        }
        set
        {
            this.description = value;
            OnPropertyChanged("Description");
        }
    }

    public ChildObject(int iD, string description)
    {
        this.id = iD;
        this.description = description;
    }

    protected virtual void OnPropertyChanged(string propertyName)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

Workaround: reset the TreeViewElement after adding the record:

radTreeView1.TreeViewElement.Update(RadTreeViewElement.UpdateActions.Reset);
Completed
Last Updated: 29 Oct 2015 12:00 by ADMIN
To reproduce:
- Add items to the tree view (scrollbar must appear)
- Add context menu item which adds a new node and puts it in edit mode.
- Add a new node with the context menu item, scroll to the bottom, add item again.
- Scroll up and add item one more time.

Workaround:
void treeView_EditorRequired(object sender, TreeNodeEditorRequiredEventArgs e)
{
    e.Editor = new TreeViewTextBoxEditor();
}
Completed
Last Updated: 29 Oct 2015 07:31 by ADMIN
To reproduce: 
           radTreeView1.CheckBoxes = true;
            radTreeView1.TriStateMode = true;
            radTreeView1.AutoCheckChildNodes = true;

            RadTreeNode root = radTreeView1.Nodes.Add("Home");
            root.Expanded = true;

            RadTreeNode node1 = new RadTreeNode("Minimal");
            node1.CheckState = Telerik.WinControls.Enumerations.ToggleState.On;

            root.Nodes.Add(node1);

Workaround: first add the node to the Nodes collection and only then set its CheckState
Completed
Last Updated: 29 Oct 2015 07:20 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();

    for (int i = 0; i < 20; i++)
    {
        this.radTreeView1.Nodes.Add("Node"+i);
    }
    this.radTreeView1.AllowEdit = true;
}

The attached gif file illustrates the steps.

Workaround:
 this.radTreeView1.VScrollBar.ValueChanged+=VScrollBar_ValueChanged;
private void VScrollBar_ValueChanged(object sender, EventArgs e)
{
    this.radTreeView1.EndEdit();
}