If you hide a node using the advanced builder go to an other node and they try to get back to the first node, you will notice that you will not be able to do so.
ADD SaveXML and LoadXML method of RadTreeView that allows loading and saving xml via stream
Add TreeViewXml property to RadTreeView that allows xml serialization by string type
When you change the dock state of window in RadDock, the hosted RadTreeView shows only the nodes from first level, if data relation binding is used.
The RadTreeView throws NullReferenceException when scrolling is performed if it is loaded from xml document. Loading the following xml document causes the issue: <TreeView xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ShowLines="true"> <Nodes Expanded="true" Text="Test1" ImageIndex="0"> <Nodes Expanded="true" Text="Test2" ImageIndex="0"> <Nodes Expanded="true" Text="Test3" ImageIndex="2"> <Nodes Expanded="true" Text="Test4" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test5" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test6" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test7" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test18" ImageIndex="1"> <Nodes Text="Test9" ImageIndex="3" /> <Nodes Text="Test10" ImageIndex="3" /> </Nodes> <Nodes Expanded="true" Text="Test11" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test12" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test13" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test14" ImageIndex="1"> <Nodes Text="Test15" ImageIndex="3" /> <Nodes Text="Test16" ImageIndex="3" /> <Nodes Expanded="true" Text="Test17" ImageIndex="4"> <Nodes Expanded="true" Text="Test18" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test19" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test20" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> </Nodes> </Nodes> <Nodes Expanded="true" Text="Test20" ImageIndex="2"> <Nodes Expanded="true" Text="Test21" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test22" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test23" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test24" ImageIndex="1"> <Nodes Text="Test25" ImageIndex="3" /> <Nodes Text="Test26" ImageIndex="3" /> <Nodes Text="Test27" ImageIndex="3" /> <Nodes Text="Test28" ImageIndex="3" /> </Nodes> <Nodes Expanded="true" Text="Test29" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test30" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test31" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> </Nodes> <Nodes Expanded="true" Text="Test32" ImageIndex="0"> </Nodes> <Nodes Expanded="true" Text="Test33" ImageIndex="0"> <Nodes Expanded="true" Text="Test34" ImageIndex="0"> <Nodes Expanded="true" Text="Test35" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test36" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test37" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test38" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test39" ImageIndex="1"> <Nodes Text="Test40" ImageIndex="3" /> <Nodes Text="Test41" ImageIndex="3" /> </Nodes> <Nodes Expanded="true" Text="Test42" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test43" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test44" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test45" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test46" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> <Nodes Expanded="true" Text="Test47" ImageIndex="0"> <Nodes Expanded="true" Text="Test48" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test49" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test50" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test51" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test52" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test53" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> <Nodes Expanded="true" Text="Test54" ImageIndex="0"> <Nodes Expanded="true" Text="Test55" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test56" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test57" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test58" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test59" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test60" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> </Nodes> </Nodes> </TreeView>
If you add nodes in the following manner:
Private arCategories() As String = {"Not Used", "Category1", "Category2", "Category3", "Category4", "Category5"}
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim node As RadTreeNode
node = Me.RadTreeView1.Nodes.Add(arCategories(1))
node.Image = My.Resources.img1
AddItems(node)
node = Me.RadTreeView1.Nodes.Add(arCategories(2))
node.Image = My.Resources.img2
AddItems(node)
node = Me.RadTreeView1.Nodes.Add(arCategories(3))
node.Image = My.Resources.img3
AddItems(node)
node = Me.RadTreeView1.Nodes.Add(arCategories(4))
node.Image = My.Resources.img4
AddItems(node)
node = Me.RadTreeView1.Nodes.Add(arCategories(5))
node.Image = My.Resources.img5
AddItems(node)
For Each nd As RadTreeNode In Me.RadTreeView1.Nodes
For Each n As RadTreeNode In nd.Nodes
n.Image = nd.Image
Next
Next
End Sub
Private Sub AddItems(ByVal node As RadTreeNode)
For i As Integer = 1 To 4
node.Nodes.Add("Item" & i)
Next
End Sub
the vertical scroll is not calculated correctly.
Vertical scroll bar is not shown if the expanded node's child nodes have been collapsed in NodeExpandChanged event previously. The code snippet bellow causes the issue:
void radTreeView1_NodeExpandedChanged(object sender, RadTreeViewEventArgs e)
{
bool isExpanded = e.Node.Expanded;
if (!isExpanded)
{
foreach (RadTreeNode node in e.Node.Nodes)
{
node.Expanded = false;
}
}
}
The RadTreeView throws exception when the BindingSource.CancelEdit is invoked.
NullReferenceException is thrown, when end edit performs in RadTreeView. To reproduce the issue: 1. Bind the grid to table 2. Add new record programmatically 3. Call BeginEdit of the added node 4. Edit the text of the node from the editor 5. Press ENTER 6. Exception is thrown.
The check boxes are squeezed when the expanded state of the child nodes is changed in NodeCheckedChanged event. Possible workaround: use Begin-End update block
You cannot unsubscribe from the NodeCheckedChanging event of RadTreeView.
If ALT key is pressed, the dragged nodes should be copied when drag and drop is performed.
If the ShowLines property is set to true and a node's expander is hidded, a link line should appear instead. Comment: When using full lazy mode RadGridView displays expander icon for all nodes. When it is hidden there is a whitespace. You can show tree lines only with code.
ValueValidating and ValidationError are fired twice when message box is shown in the event handler of ValidationError event.
While a node is dragged and right mouse button is clicked, the dragged node is replaced with the selected node.
When the ShowLines property is set to true, the lines that link nodes in RadTreeView are not rendered appropriately for some levels. Comment: When using full lazy mode RadGridView displays expander icon for all nodes. When it is hidden there is a whitespace. You can show tree lines only with code.
A NullReferenceException is thrown when the nodes are cleared and new selected nodes are determined.
NodeMouseDown event is not fired when the image of the TreeNodeElement is clicked.
When you add a new node in self-referencing hierarchy, several nodes are added on random levels. In addition, if you remove an existing node, a NullReferenceException is thrown.
test project:
using System.Data;
using System.Windows.Forms;
using Telerik.WinControls.UI;
namespace Lab.Tree
{
public partial class TreeSelfReferenceAddFrom : Form
{
private RadTreeView treeView = new RadTreeView();
public TreeSelfReferenceAddFrom()
{
InitializeComponent();
treeView.Dock = DockStyle.Fill;
treeView.Parent = this;
treeView.AllowDefaultContextMenu = true;
treeView.AllowAdd = true;
treeView.AllowEdit = true;
treeView.AllowDrop = true;
treeView.AllowDragDrop = true;
treeView.AllowRemove = true;
DataTable table = new DataTable();
table.Columns.Add("ID");
table.Columns.Add("ParentID");
table.Columns.Add("Name");
table.Rows.Add(1, 0, "Name1");
table.Rows.Add(2, 0, "Name2");
table.Rows.Add(3, 0, "Name3");
table.Rows.Add(4, 1, "Name5");
table.Rows.Add(5, 1, "Name6");
table.Rows.Add(6, 3, "Name6");
treeView.DisplayMember = "Name";
treeView.ChildMember = "ID";
treeView.ParentMember = "ParentID";
treeView.DataSource = table;
}
}
}
When the RadTreeView is not in full row select mode, the selected node crops its text.