Approved
Last Updated: 24 Aug 2018 12:59 by ADMIN
Workaround:
private void radButton1_Click(object sender, EventArgs e)
{
    var allNodes = radTreeView1.TreeViewElement.GetNodes().ToList();

    int row = 0;
  
    Workbook workbook = new Workbook();
    Worksheet newWorksheet = workbook.Worksheets.Add();

    foreach (var item in allNodes)
    {

        CellSelection cell = newWorksheet.Cells[row, item.Level];
        cell.SetValue(item.Text);

        cell = newWorksheet.Cells[row++, 2];
        cell.SetValue(item.Checked);

    }

    var formatProvider = new XlsxFormatProvider();


    var bytes = formatProvider.Export(workbook);
    File.WriteAllBytes(@"D:\Test.xlsx", bytes);


}
Completed
Last Updated: 20 Aug 2018 13:22 by Dimitar
ADMIN
Created by: Dimitar
Comments: 0
Category: TreeView
Type: Bug Report
0
To reproduce.
- Add 100 nodes so the scroll appears. 
- Try scrolling to bottom.

Workaround:
radTreeView1.TreeViewElement.Scroller.ScrollMode = ItemScrollerScrollModes.Discrete;
Completed
Last Updated: 02 Aug 2018 10:08 by Dimitar
Scenario: Populate RadTreeView with data coming from an XML: https://docs.telerik.com/devtools/winforms/treeview/data-binding/binding-to-xml-data The XML file stores a boolean value "IsActive" which will determine the check state of the node. Then, specify the RadTreeView. CheckMember property as well

            string fileName = @"TempFile.xml";
            DataSet tocDataSet = new DataSet("Toc");
            tocDataSet.ReadXml(fileName);
            this.radTreeView1.DataMember = "FlatNode";
            this.radTreeView1.DisplayMember = "Title";
            this.radTreeView1.ChildMember = "Id";
            this.radTreeView1.ParentMember = "ParentId";
            this.radTreeView1.CheckedMember = "IsActive";
            this.radTreeView1.DataSource = tocDataSet;

When you try to check/uncheck a node, an exception occurs indicating the inability to convert the string value "On" to ToggleState. Currently RadTreeView supports only bool, bool? to ToggleState and vice versa. The TypeConverter should be exposed so the developer can change it and implement the custom conversion.

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfFlatNode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <FlatNode>
    <Title>New Name</Title>
    <IsActive>false</IsActive>
    <ParentId>0</ParentId>
    <Id>1</Id>
  </FlatNode>
  <FlatNode>
    <Title>1st Node</Title>
    <IsActive>false</IsActive>
    <ParentId>1</ParentId>
    <Id>2</Id>
  </FlatNode>
  <FlatNode>
    <Title>1.1</Title>
    <IsActive>true</IsActive>
    <ParentId>2</ParentId>
    <Id>3</Id>
  </FlatNode>
  <FlatNode>
    <Title>1.2</Title>
    <IsActive>false</IsActive>
    <ParentId>2</ParentId>
    <Id>4</Id>
  </FlatNode>
  <FlatNode>
    <Title>1.3</Title>
    <IsActive>false</IsActive>
    <ParentId>2</ParentId>
    <Id>5</Id>
  </FlatNode>
  <FlatNode>
    <Title>2.0</Title>
    <IsActive>true</IsActive>
    <ParentId>1</ParentId>
    <Id>6</Id>
  </FlatNode>
  <FlatNode>
    <Title>2.1</Title>
    <IsActive>true</IsActive>
    <ParentId>6</ParentId>
    <Id>7</Id>
  </FlatNode>
  <FlatNode>
    <Title>2.2</Title>
    <IsActive>true</IsActive>
    <ParentId>6</ParentId>
    <Id>8</Id>
  </FlatNode>
  <FlatNode>
    <Title>2.3</Title>
    <IsActive>true</IsActive>
    <ParentId>6</ParentId>
    <Id>9</Id>
  </FlatNode>
  <FlatNode>
    <Title>3.0</Title>
    <IsActive>true</IsActive>
    <ParentId>1</ParentId>
    <Id>10</Id>
  </FlatNode>
  <FlatNode>
    <Title>4.0</Title>
    <IsActive>false</IsActive>
    <ParentId>1</ParentId>
    <Id>11</Id>
  </FlatNode>
  <FlatNode>
    <Title>5.0</Title>
    <IsActive>true</IsActive>
    <ParentId>1</ParentId>
    <Id>12</Id>
  </FlatNode>
  <FlatNode>
    <Title>3.1</Title>
    <IsActive>false</IsActive>
    <ParentId>10</ParentId>
    <Id>13</Id>
  </FlatNode>
  <FlatNode>
    <Title>New Item</Title>
    <IsActive>true</IsActive>
    <ParentId>8</ParentId>
    <Id>15</Id>
  </FlatNode>
  <FlatNode>
    <Title>New Item</Title>
    <IsActive>true</IsActive>
    <ParentId>8</ParentId>
    <Id>16</Id>
  </FlatNode>
</ArrayOfFlatNode>

Completed
Last Updated: 25 Jun 2018 10:07 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 2
Category: TreeView
Type: Feature Request
2
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);
                }
            }

            protected override bool ProcessContextMenu(Point location)
            {
                RadTreeNode node = this.GetNodeAt(location);
                if (node == null)
                {
                    RadContextMenu menu = new RadContextMenu();
                    RadMenuItem item = new RadMenuItem();
                    item.Text = "Add a root node";
                    menu.Items.Add(item);
                    item.Click += item_Click;
                    TreeViewContextMenuOpeningEventArgs args = new TreeViewContextMenuOpeningEventArgs(node, menu);
                    OnContextMenuOpening(args);

                    if (!args.Cancel)
                    {
                        menu.Show(this.ElementTree.Control, location);
                        return true;
                    }
                }
                return base.ProcessContextMenu(location);
            }

            private void item_Click(object sender, EventArgs e)
            {
                this.Nodes.Add(new RadTreeNode("New root"));
            }
        }
Approved
Last Updated: 21 Jun 2018 14:39 by ADMIN
Say you have a button which clears the old nodes and adds a number of new child nodes to the currently selected node. If the selected node is collapsed, the newly added nodes are not visible but the scrollbar updates as if they were.

Workaround the issue by using the BeginUpdate/EndUpdate methods of RadTreeView when updating the nodes:
radTreeView1.BeginUpdate();
    node.Nodes.Clear();
    foreach (RadTreeNode treeNode in nodes)
    {
        node.Nodes.Add((RadTreeNode)treeNode.Clone());
    }
    radTreeView1.EndUpdate();
Declined
Last Updated: 13 Jun 2018 14:25 by ADMIN
How to reproduce:
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    private BindingList<TreeViewDataObject> data;
    public static int Id = 0;

    public RadForm1()
    {
        InitializeComponent();

        var theme = new FluentTheme();
        ThemeResolutionService.ApplicationThemeName = theme.ThemeName;

        this.data = new BindingList<TreeViewDataObject>();


        for (int i = 1; i <= 5; i += 1)
        {
            Id++;
            TreeViewDataObject root = new TreeViewDataObject()
            {
                Id = Id,
                ParentId = -1,
                Name = "Root: " + i
            };

            this.data.Add(root);

            for (int j = 1; j <= 3; j++)
            {
                Id++;
                TreeViewDataObject child = new TreeViewDataObject()
                {
                    Id = Id,
                    ParentId = root.Id,
                    Name = "Child: " + Id
                };

                this.data.Add(child);

                for (int K = 1; K <= 5; K++)
                {
                    Id++;

                    TreeViewDataObject c = new TreeViewDataObject()
                    {
                        Id = Id,
                        ParentId = child.Id,
                        Name = "Child: " + Id
                    };

                    this.data.Add(c);
                }
            }
        }

        this.radTreeView1.DataSource = this.data;
        this.radTreeView1.DisplayMember = "Name";
        this.radTreeView1.ParentMember = "ParentId";
        this.radTreeView1.ChildMember = "Id";
        this.radTreeView1.RelationBindings.Add(new RelationBinding(this.data, "Name", "ParentId", "Id"));

        this.radTreeView1.ExpandAll();

        this.radTreeView1.TreeViewElement.AllowEdit = true;
        this.radTreeView1.TreeViewElement.AllowAdd = true;
        this.radTreeView1.TreeViewElement.AllowRemove = true;
    }
}

  public class TreeViewDataObject
    {
        public int Id { get; set; }

        public int ParentId { get; set; }

        public string Name { get; set; }
    }

Workaround: Handle the ContextMenuOpening event and add logic for creating a new record in the data source object
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    private BindingList<TreeViewDataObject> data;
    private int id = 0;

    public RadForm1()
    {
        InitializeComponent();

        var theme = new FluentTheme();
        ThemeResolutionService.ApplicationThemeName = theme.ThemeName;

        this.data = new BindingList<TreeViewDataObject>();


        for (int i = 1; i <= 5; i += 1)
        {
            id++;
            TreeViewDataObject root = new TreeViewDataObject()
            {
                Id = id,
                ParentId = -1,
                Name = "Root: " + i
            };

            this.data.Add(root);

            for (int j = 1; j <= 3; j++)
            {
                id++;
                TreeViewDataObject child = new TreeViewDataObject()
                {
                    Id = id,
                    ParentId = root.Id,
                    Name = "Child: " + id
                };

                this.data.Add(child);

                for (int K = 1; K <= 5; K++)
                {
                    id++;

                    TreeViewDataObject c = new TreeViewDataObject()
                    {
                        Id = id,
                        ParentId = child.Id,
                        Name = "Child: " + id
                    };

                    this.data.Add(c);
                }
            }
        }

        this.radTreeView1.DataSource = this.data;
        this.radTreeView1.DisplayMember = "Name";
        this.radTreeView1.ParentMember = "ParentId";
        this.radTreeView1.ChildMember = "id";
        this.radTreeView1.RelationBindings.Add(new RelationBinding(this.data, "Name", "ParentId", "id"));

        this.radTreeView1.ExpandAll();
        
        this.radTreeView1.ContextMenuOpening += RadTreeView1_ContextMenuOpening;

        this.radTreeView1.TreeViewElement.AllowEdit = true;
        this.radTreeView1.TreeViewElement.AllowAdd = true;
        this.radTreeView1.TreeViewElement.AllowRemove = true;
    }

    private void RadTreeView1_ContextMenuOpening(object sender, TreeViewContextMenuOpeningEventArgs e)
    {
        TreeViewDefaultContextMenu treeMenu = e.Menu as TreeViewDefaultContextMenu;
        treeMenu.Items.Remove(treeMenu.AddMenuItem);

        RadMenuItem item = new RadMenuItem("&New");

        item.Click -= Item_Click;
        item.Click += Item_Click;
        treeMenu.Items.Insert(2, item);
    }

    private void Item_Click(object sender, EventArgs e)
    {
        RadTreeNode parent = this.radTreeView1.SelectedNode;
        if (parent == null || parent.DataBoundItem == null)
        {
            return;
        }

        this.id++;
        BindingList<TreeViewDataObject> data = this.radTreeView1.DataSource as BindingList<TreeViewDataObject>;
        TreeViewDataObject newObject = new TreeViewDataObject()
        {
            Id = this.id,
            ParentId = ((TreeViewDataObject)parent.DataBoundItem).Id,
            Name = "New Name"
        };

        parent.Expanded = true;
        data.Add(newObject);
    }
}

public class TreeViewDataObject
{
    public int Id { get; set; }

    public int ParentId { get; set; }

    public string Name { get; set; }
}
Completed
Last Updated: 13 Jun 2018 07:09 by Dimitar
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: TreeView
Type: Bug Report
1
For the MS TreeView the HideSelection property gets or sets a value indicating whether the selected tree node remains highlighted even when the tree view has lost the focus. However, it doesn't work in RadTreeView.
Declined
Last Updated: 12 Jun 2018 08:14 by ADMIN
To reproduce: add some nodes to the tree view at design time

        public RadForm1()
        {
            InitializeComponent();

            this.radTreeView1.AllowDragDrop = true;
            this.radTreeView1.DragEnding += radTreeView1_DragEnding;
        }
        
        private void radTreeView1_DragEnding(object sender, Telerik.WinControls.UI.RadTreeViewDragCancelEventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to move?", "Question", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
            {
                e.Cancel = true;
            }
        }

Then try to drag and drop a node. You will notice that the application hangs

Workaround: use RadMessageBox
Completed
Last Updated: 01 Jun 2018 15:12 by Dimitar
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: TreeView
Type: Bug Report
0
To reproduce: add several nodes at design time in order to obtain a vertical scrollbar. Enable the drag and drop functionality by setting the AllowDragDrop property to true. If you start dragging you will notice that the RadTreeView doesn't auto-scroll  when you drag close to the borders of the visible area. 

Workaround: 

    Class CustomDragDropService
        Inherits TreeViewDragDropService

        Public Sub New(ByVal owner As RadTreeViewElement)
            MyBase.New(owner)
        End Sub

        Protected Overrides Sub SetHintWindowPosition(ByVal mousePt As Point)
        End Sub
    End Class

    Class CustomTreeViewElement
        Inherits RadTreeViewElement

        Protected Overrides ReadOnly Property ThemeEffectiveType As Type
            Get
                Return GetType(RadTreeViewElement)
            End Get
        End Property

        Protected Overrides Function CreateDragDropService() As TreeViewDragDropService
            Return New CustomDragDropService(Me)
        End Function
    End Class

    Class CustomTreeView
        Inherits RadTreeView

        Protected Overrides Function CreateTreeViewElement() As RadTreeViewElement
            Return New CustomTreeViewElement()
        End Function

        Public Overrides Property ThemeClassName As String
            Get
                Return GetType(RadTreeView).FullName
            End Get
            Set(value As String)
                MyBase.ThemeClassName = value
            End Set
        End Property
    End Class
Completed
Last Updated: 23 May 2018 08:42 by Dimitar
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: TreeView
Type: Bug Report
1
To reproduce: please refer to the attached project.

Workaround: if you access the RadTreeNode.TreeViewElement property, the TreeView property is loaded.
Completed
Last Updated: 16 Apr 2018 11:57 by Dimitar
Completed
Last Updated: 05 Feb 2018 09:25 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: TreeView
Type: Bug Report
1
When you start dragging a node you will notice that the drag hint is constantly flickering.
Completed
Last Updated: 02 Feb 2018 15:36 by ADMIN
To reproduce:

DataTable dt = new DataTable();
 
public Form1()
{
    InitializeComponent();

    dt.Columns.Add("Id", typeof(int));
    dt.Columns.Add("ParentID", typeof(int));
    dt.Columns.Add("NodeName", typeof(string));
    dt.Rows.Add(1, 0, "Category1");
    dt.Rows.Add(2, 1, "Category2");
    dt.Rows.Add(3, 0, "Category3");
    dt.Rows.Add(4, 3, "Category4");
    dt.Rows.Add(5, 3, "Category5");
    dt.Rows.Add(6, 3, "Category6");
    dt.Rows.Add(7, 6, "Category7");
    dt.Rows.Add(8, 6, "Category8"); 

    this.radTreeView1.DataSource = dt; 

    this.radTreeView1.DisplayMember = "NodeName";
    this.radTreeView1.ChildMember = "ID";
    this.radTreeView1.ParentMember = "ParentID";

    this.radTreeView1.ExpandAll();

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

    this.radLabel1.Text = "Number of rows: " + dt.Rows.Count;
    
    this.radTreeView1.NodeRemoved += radTreeView1_NodeRemoved;
}

private void radTreeView1_NodeRemoved(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e)
{
    this.radLabel1.Text = "Number of rows: " + dt.Rows.Count;
}

Workaround: perform the delete operation programmatically by modifying the default context menu:

 this.radTreeView1.ContextMenuOpening += radTreeView1_ContextMenuOpening;

private void radTreeView1_ContextMenuOpening(object sender, TreeViewContextMenuOpeningEventArgs e)
{
    foreach (RadMenuItem item in e.Menu.Items)
    {
        if (item.Text == "&Delete")
        {
            item.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
        }
        else
        {
            item.Visibility = Telerik.WinControls.ElementVisibility.Visible;
        }
    }

    RadMenuItem removeItem = new RadMenuItem("Remove");
    e.Menu.Items.Add(removeItem);
    removeItem.Click += item_Click;
}

private void item_Click(object sender, EventArgs e)
{
    DeleteSubNodes(this.radTreeView1.SelectedNode);
    this.radLabel1.Text = "Number of rows: " + dt.Rows.Count;
}

private void DeleteSubNodes(Telerik.WinControls.UI.RadTreeNode node)
{
    if (node.Nodes.Count == 0)
    {
        dt.Rows.Remove(((DataRowView)node.DataBoundItem).Row);
    }
    else
    {
        foreach (RadTreeNode n in node.Nodes)
        {
            DeleteSubNodes(n);
        }
        dt.Rows.Remove(((DataRowView)node.DataBoundItem).Row);
    }
}
Completed
Last Updated: 20 Nov 2017 12:18 by ADMIN
To reproduce: - add a RadTreeView - enable multiselect - select at least 1 node - call radTreeView1.SelectedNodes.Clear() Workaround: Clear the nodes manually: foreach (var node in this.radTreeView1.SelectedNodes.ToList()) { node.Selected = false; }
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: 15 Aug 2017 10:29 by ADMIN
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;
    }
}

Completed
Last Updated: 15 Aug 2017 10:20 by ADMIN
To reproduce:

public RadForm1()
{
    InitializeComponent(); 

    for (int i = 0; i < 10; i++)
    {
        this.radTreeView1.Nodes.Add("Node1." + i); 
    }
    this.radTreeView1.AllowDragDrop = true; 
    
    this.radTreeView1.TreeViewElement.DragDropService.PreviewDragDrop+=DragDropService_PreviewDragDrop;
}

private void DragDropService_PreviewDragDrop(object sender, RadDropEventArgs e)
{
    e.Handled = true;
}
Completed
Last Updated: 15 Aug 2017 10:20 by ADMIN
To reproduce:
for (int i = 0; i < 10; i++)
{
   this.radTreeView1.Nodes.Add("Node1." + i);
}
this.radTreeView1.AllowDragDrop = true; 

this.radTreeView1.TreeViewElement.DragDropService.ShowDragHint = false;


Workaround: this.radTreeView1.TreeViewElement.DragDropService.PreviewDragHint += DragDropService_PreviewDragHint;

private void DragDropService_PreviewDragHint(object sender, PreviewDragHintEventArgs e)
{ 
    e.UseDefaultHint = false;
}
Completed
Last Updated: 15 Aug 2017 10:20 by ADMIN
To reproduce: please refer to the attached gif file.

Workaround: insteda of hiding the expander by the ShowExpandCollapse property use the NodeFormatting event as follows:

private void radTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
        {
            e.NodeElement.ExpanderElement.Visibility = ElementVisibility.Collapsed;
        }