Completed
Last Updated: 08 Apr 2016 11:42 by ADMIN
To reproduce: use the attached sample project and follow the steps:

1. Filter by "Jo".
2. Press the "Refresh" button.
3. Press the "Clear Filter" button.

Note: if there is no applied filter when rebinding, the nodes order is correct. Please refer to the attached gif file.

Workaround: clear the filter before setting the DataSource property and restore ethe filter afterwards:
string filter = this.radTreeView1.Filter + "";
this.radTreeView1.Filter = "";
this.radTreeView1.DataSource = dt;
this.radTreeView1.DisplayMember = "Name";
this.radTreeView1.ValueMember = "Id";
this.radTreeView1.Filter = filter;
Completed
Last Updated: 29 Jun 2016 06:49 by ADMIN
Workaround: create a custom TreeNodeContentElement and override the Synchronize method

public class MyTreeNodeContentElement : TreeNodeContentElement
{
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(TreeNodeContentElement);
        }
    }

    public override void Synchronize()
    {
        TreeNodeElement treeNodeElement = NodeElement;

        if (treeNodeElement == null || treeNodeElement.Data == null || treeNodeElement.Data.TreeViewElement == null || treeNodeElement.Data.Text == null)
        {
            return;
        }

        this.Text = treeNodeElement.Data.Text;
    }

}

public class MyTreeNodeElement : TreeNodeElement
{
    protected override TreeNodeContentElement CreateContentElement()
    {
        return new MyTreeNodeContentElement();
    }

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

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radTreeView1.AllowEdit = true;

        this.radTreeView1.DisplayMember = "name";
        this.radTreeView1.ParentMember = "pid";
        this.radTreeView1.ChildMember = "id";
        this.radTreeView1.DataSource = this.GetSampleData();

        this.radTreeView1.CreateNodeElement += radTreeView1_CreateNodeElement;
        this.radTreeView1.ValueChanged += radTreeView1_ValueChanged;
    }

    private void radTreeView1_CreateNodeElement(object sender, Telerik.WinControls.UI.CreateTreeNodeElementEventArgs e)
    {
        e.NodeElement = new MyTreeNodeElement();
    }

    private void radTreeView1_ValueChanged(object sender, Telerik.WinControls.UI.TreeNodeValueChangedEventArgs e)
    {
       this.UpdateDb();
    }

    private void UpdateDb()
    {
        this.radTreeView1.DataSource = null;
        DataTable dt = this.GetSampleData();
        this.radTreeView1.DataSource = dt;
    }

    private DataTable GetSampleData()
        {
            DataTable dt = new DataTable();

            DataColumn dc = new DataColumn();
            dc.ColumnName = "id";
            dc.DataType = typeof(int);
            dt.Columns.Add(dc);

            DataColumn dc1 = new DataColumn();
            dc1.ColumnName = "name";
            dc1.DataType = typeof(string);
            dt.Columns.Add(dc1);

            DataColumn dc2 = new DataColumn();
            dc2.ColumnName = "pid";
            dc2.DataType = typeof(int);
            dt.Columns.Add(dc2);

            DataRow dr = dt.NewRow();
            dr[0] = 0;
            dr[1] = "My Computer";
            dr[2] = DBNull.Value;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = 1;
            dr[1] = @"C:\";
            dr[2] = 0;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = 2;
            dr[1] = @"D:\";
            dr[2] = 0;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = 3;
            dr[1] = "Program Files";
            dr[2] = 1;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = 4;
            dr[1] = "Microsoft";
            dr[2] = 3;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = 5;
            dr[1] = "Telerik";
            dr[2] = 3;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = 6;
            dr[1] = "WINDOWS";
            dr[2] = 1;
            dt.Rows.Add(dr);

            return dt;
        }
}

Completed
Last Updated: 14 Oct 2015 13:25 by ADMIN
To reproduce:
private void radTreeView1_NodesNeeded(object sender, Telerik.WinControls.UI.NodesNeededEventArgs e)
{
    for (int i = 0; i < 100; i++)
    {
        var node = new RadTreeNode("Test"+i);
        for (int j = 0; j < 10; j++)
        {
            node.Nodes.Add(new RadTreeNode("Sub"));
        }
        node.Expanded = true;

        e.Nodes.Add(node);
    }
}

Workaorund:
private void radTreeView1_NodesNeeded(object sender, Telerik.WinControls.UI.NodesNeededEventArgs e)
{
    radTreeView1.BeginUpdate();
    for (int i = 0; i < 100; i++)
    {
        var node = new RadTreeNode("Test"+i);
        for (int j = 0; j < 10; j++)
        {
            node.Nodes.Add(new RadTreeNode("Sub"));
        }
        node.Expanded = true;

        e.Nodes.Add(node);
       

    }
    radTreeView1.EndUpdate();
}
Completed
Last Updated: 29 Sep 2016 14:33 by ADMIN
To reproduce:
- Add a lot of nodes to the tree (scrollbars must appear).
- Use the following code to add nodes:
public RadForm1()
{
    InitializeComponent();
    radTreeView1.AllowEdit = true;
    RadContextMenu menu = new RadContextMenu();
    RadMenuItem add = new RadMenuItem();
    add.Click += add_Click;
    add.Text = "add";
    menu.Items.Add(add);
    radTreeView1.RadContextMenu = menu;

}
void add_Click(object sender, EventArgs e)
{
    RadTreeNode node = radTreeView1.SelectedNode;

    var newNode = node.Nodes.Add("new node");
    node.Expanded = true;
    radTreeView1.SelectedNode = newNode;
    radTreeView1.BeginEdit();
}
- Add a node and scroll

Workaround:
public RadForm1()
{
    InitializeComponent();
    radTreeView1.TreeViewElement.VScrollBar.Scroll += VScrollBar_Scroll;
    radTreeView1.MouseWheel += TreeViewElement_MouseWheel;
}

void TreeViewElement_MouseWheel(object sender, MouseEventArgs e)
{
    var radTreeView = sender as RadTreeView;
    if (radTreeView.IsEditing)
    {
        radTreeView.EndEdit();
    }
}

void VScrollBar_Scroll(object sender, ScrollEventArgs e)
{
    var radTreeView = (sender as RadScrollBarElement).ElementTree.Control as RadTreeView;
    if (radTreeView.IsEditing)
    {
        radTreeView.EndEdit();
    }
}

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
Unplanned
Last Updated: 15 Aug 2017 10:02 by ADMIN
ADMIN
Created by: Ralitsa
Comments: 0
Category: TreeView
Type: Feature Request
1

			
Completed
Last Updated: 12 Sep 2015 06:03 by ADMIN
Workaround:

After updating the binding source reset the data source of the tree

this.radTreeView.DataSource = null;

this.radTreeView.DataSource = this.MyBindingSource;
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();
}
Completed
Last Updated: 30 Jun 2015 08:28 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();

    this.radTreeView1.AllowDragDrop = true;
    this.radTreeView2.AllowDragDrop = true;
    for (int i = 0; i < 5; i++)
    {
        this.radTreeView1.Nodes.Add("Node1." + i);
        this.radTreeView2.Nodes.Add("Node2." + i);
    }
    this.radTreeView1.ScreenTipNeeded += radTreeView1_ScreenTipNeeded;
    this.radTreeView2.ScreenTipNeeded += radTreeView1_ScreenTipNeeded;
}

RadOffice2007ScreenTipElement _screenTip = new RadOffice2007ScreenTipElement();

private void radTreeView1_ScreenTipNeeded(object sender, Telerik.WinControls.ScreenTipNeededEventArgs e)
{
    _screenTip.CaptionLabel.Text = "Caption";
    _screenTip.MainTextLabel.Text = "text";
    _screenTip.AutoSize = true;
    e.Delay = 2000;
    e.Item.ScreenTip = _screenTip;
}

Steps:
1. Drag a node from the first RadTreeView to the other while the screen-tip is shown for the dragged node.
2. When the screen-tip is about to be hidden, the error occurs.

Workaround:

private void radTreeView1_DragStarting(object sender, RadTreeViewDragCancelEventArgs e)
{
    if (_screenTip.IsElementVisible)
    {
        this.radTreeView1.Behavior.HideScreenTip();
    }
   
}
Completed
Last Updated: 08 Apr 2016 10:26 by ADMIN
To reproduce: use the following code:

public Form1()
{
    InitializeComponent();

    this.radTreeView1.MultiSelect = true;
    for (int i = 0; i < 3; i++)
    {
        RadTreeNode node = new RadTreeNode();
        node.Text = "Node." + i;
        for (int j = 0; j < 3; j++)
        {
            node.Nodes.Add(new RadTreeNode("Node." + i + "." + j));
        }
        this.radTreeView1.Nodes.Add(node);
    }
    this.radTreeView1.SelectedNodeChanged += radTreeView1_SelectedNodeChanged;
}

private void radTreeView1_SelectedNodeChanged(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e)
{
    Console.WriteLine(e.Node.Text + ">> Selected: " + e.Node.Selected);
}

1.Select a node
2.Press Ctrl and click over the selected node again in order to unselect it. The SelectedNodeChanged event will not fire.

Workaround:

public class MyRadTreeNode : RadTreeNode
{
    public MyRadTreeNode(string text) : base(text)
    {
    }
    
    private static readonly MethodInfo OnSelectedNodeChangedMethodInfo =
        typeof(RadTreeViewElement).GetMethod("OnSelectedNodeChanged",
            BindingFlags.NonPublic | BindingFlags.Instance, null,
            new Type[] { typeof(RadTreeNode), typeof(RadTreeViewAction) }, null);

    protected override void OnNotifyPropertyChanged(PropertyChangedEventArgs args)
    {
        base.OnNotifyPropertyChanged(args);

        if (args.PropertyName == "Selected" && TreeViewElement != null)
        {
            OnSelectedNodeChangedMethodInfo.Invoke(TreeViewElement, new object[] { this, RadTreeViewAction.ByMouse });
        }
    }
}

Completed
Last Updated: 08 Apr 2016 11:27 by ADMIN
Error: "Object of type 'Telerik.WinControls.Enumerations.ToggleState' cannot be converted to type 'System.Boolean'."

To reproduce:

public Form1()
{
    InitializeComponent();

    List<Parent> dataItems = new List<Parent>();
    Parent currentParent;
    Child currentChild;
    List<Child> children;
    string parentId = string.Empty;
    string childId = string.Empty;
    for (int i = 1; i <= 5; i++)
    {
        parentId = Guid.NewGuid().ToString();

        children = new List<Child>();
        for (int j = 1; j < 5; j++)
        {
            childId = Guid.NewGuid().ToString();
            currentChild = new Child(childId, parentId, "SubNode." + i + "." + j, j % 2 == 0);
            children.Add(currentChild);
        }
        currentParent = new Parent(parentId, "Node." + i, i % 2 == 0,children);
        dataItems.Add(currentParent);
    }

    radTreeView1.DataSource = dataItems;
    radTreeView1.DisplayMember = "Title\\Name";
    radTreeView1.ChildMember = "Parent\\Children";
    radTreeView1.CheckedMember = "IsActive\\Status";
    radTreeView1.CheckBoxes = true;
}

public class Parent 
{
    public string ParentId { get; set; }

    public string Title { get; set; }

    public bool IsActive { get; set; }

    public List<Child> Children { get; set; }

    public Parent(string parentId, string title, bool isActive, List<Child> children)
    {
        this.ParentId = parentId;
        this.Title = title;
        this.IsActive = isActive;
        this.Children = children;
    }
}

public class Child
{
    public string ChildId { get; set; }

    public string ParentId { get; set; }

    public string Name { get; set; }

    public bool Status { get; set; }

    public Child(string childId, string parentId, string name, bool status)
    {
        this.ChildId = childId;
        this.ParentId = parentId;
        this.Name = name;
        this.Status = status;
    }
}

Workaround: Use a custom TypeConverter for the boolean properties:

public class ToggleStateConverter : TypeConverter
{
    public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
    {
        return destinationType == typeof(ToggleState);
    }

    public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
    {
        if (value is bool)
        {
            switch ((bool)value)
            {
                case true:
                    return ToggleState.On;
                case false:
                    return ToggleState.Off;
                default :
                    return ToggleState.Indeterminate;
            }
        }
        return base.ConvertTo(context, culture, value, destinationType);
    }

    public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
    {
        return sourceType == typeof(ToggleState);
    }

    public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
    {
        ToggleState state = (ToggleState)value;

        switch (state)
        {
            case ToggleState.On:
                return true;
            case ToggleState.Off:
                return false;
            case ToggleState.Indeterminate:
                return false;
        }

        return base.ConvertFrom(context, culture, value);
    }
}
Unplanned
Last Updated: 30 Mar 2016 13:39 by ADMIN
To reproduce: 
1. Drag and drop RadTreeView on the form. 
2. Set the Dock property to true
3. Add 3 or more nodes with long names 
4. Resize the form to minimum size and you will notice that the spacing between characters is changed. 

Workaround: 
If FontSize of nodes is bigger than 13, you can subscribe to the NodeFormatting event and set the AutoEllipsis property to false: 
Font font = new Font("Segoe UI", 13f, FontStyle.Regular);
void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e)
{
    e.NodeElement.ContentElement.Font = font;
    e.NodeElement.ContentElement.AutoEllipsis = false;
}

If font size is smaller, you need to set the MinSize property too: 
Font font = new Font("Segoe UI", 12f, FontStyle.Regular);
void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e)
{
    e.NodeElement.ContentElement.Font = font;     
    e.NodeElement.ContentElement.MinSize = new System.Drawing.Size(500, 18);
}
Completed
Last Updated: 31 Aug 2017 12:15 by ADMIN
Currently we do not support binding to the ToggleState.Indeterminate state automatically because it would require a change in the behavior of the Checked property. If you use the CheckedMember, the ToggleState.Indeterminate state is represent like ToggleState.On. 

Workaround: 
Subscribe to the NodeFormatting and NodeCheckedChanged events: 
void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e)
{
    Child child = e.Node.DataBoundItem as Child;
    if (child != null)
    {
        e.Node.CheckState = child.Status;
    }
}

void radTreeView1_NodeCheckedChanged(object sender, Telerik.WinControls.UI.TreeNodeCheckedEventArgs e)
{
    Child child = e.Node.DataBoundItem as Child;
    if (child != null)
    {
        child.Status = e.Node.CheckState;
    }
}
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;
    }
}
Unplanned
Last Updated: 30 Mar 2016 13:38 by ADMIN
To reproduce:
Bind the tree to the following structure:
public class DeskSites
{
    public string DeskSiteName { get; set; }

    public Channels channels { get; set; }
}

public class Channels : List<Channel>
{
    
}

public class Channel
{
    public string ChannelName { get; set; }

    public FileSets fileSets { get; set; }
}

public class FileSets : List<FileSet>
{
   
}

public class FileSet
{
    public string FileSetName { get; set; }
}
Workaround:
Use the the generic class instead of the inherited one:
public class DeskSites
{
    public string DeskSiteName { get; set; }

    public List<Channel> channels { get; set; }
}

Unplanned
Last Updated: 30 Mar 2016 13:36 by ADMIN
To reproduce:

1. Add a RadTreeView with several nodes
2. Subscribe to the EditorRequired event and specify the editor to TreeViewTextBoxEditor where its Multiline property is set to true.
3. Select a node and press F2. The editor is activated. However, when you enter some text and press Ctrl+Enter, the editor is closed. The expected behavior is that a new line is inserted.

Workaround:

private void radTreeView1_EditorRequired(object sender, TreeNodeEditorRequiredEventArgs e)
{
    CustomTreeViewTextBoxEditor editor = new CustomTreeViewTextBoxEditor();
    editor.Multiline = true;
    e.Editor = editor;
}

public class CustomTreeViewTextBoxEditor : TreeViewTextBoxEditor
{
    protected override void OnKeyDown(KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Enter &&
            e.Modifiers == Keys.Control &&
            this.Multiline)
        {
            return;
        }
        base.OnKeyDown(e);
    }
}
Completed
Last Updated: 11 Aug 2016 09:35 by ADMIN
Please refer to the attached gif file.

Workaround: set the Enabled property to false at run time.