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.
RadTreeView does not refresh iteself after adding a node on a second level.
FIX. RadTreeView - when adding row in the underlying source, the nodes in the tree are collapsed, even when using DeferRefresh
The RadTreeView does not reset the SelectedNode when the nodes are cleared in unbound mode.
How to reproduce: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { radTreeView1.CheckBoxes = true; radTreeView1.TriStateMode = true; var rootNode = new RadTreeNode("Root Node"); radTreeView1.Nodes.Add(rootNode); // Create two parent nodes var parentNode1 = new RadTreeNode("First Parent"); var parentNode2 = new RadTreeNode("Second Parent"); // Add the parent nodes to tree view's nodes collection rootNode.Nodes.AddRange(parentNode1, parentNode2); // Create a child node var radTreeNodes2 = new List<RadTreeNode> { new RadTreeNode("nA.1"), new RadTreeNode("nB.2"), new RadTreeNode("nC.3"), new RadTreeNode("nD.4"), new RadTreeNode("nE.5"), }; var radTreeNodes = new List<RadTreeNode> { new RadTreeNode("nA.1"), new RadTreeNode("nB.2"), new RadTreeNode("nC.3"), new RadTreeNode("nD.4"), new RadTreeNode("nE.5"), }; // Add the child node to the first parent's nodes collection parentNode1.Nodes.AddRange(radTreeNodes); // Remove the child from the first parent collection and add it to the second parent nodes collection //parentNode1.Nodes.Remove(childNode); parentNode2.Nodes.AddRange(radTreeNodes2); rootNode.ExpandAll(); rootNode.Checked = true; } private void textBox1_TextChanged(object sender, EventArgs e) { radTreeView1.Filter = textBox1.Text; if(radTreeView1.TopNode != null) radTreeView1.TopNode.ExpandAll(); } }
To reproduce: public RadForm1() { InitializeComponent(); BindingList<Item> items = new BindingList<Item>(); items.Add(new Item(0,"Root", CheckState.Checked,-1)); for (int i = 1; i < 5; i++) { items.Add(new Item(i, "Node" + i, CheckState.Checked,0)); } this.radTreeView1.CheckBoxes = true; this.radTreeView1.DisplayMember = "Name"; this.radTreeView1.ChildMember = "Id"; this.radTreeView1.ParentMember = "ParentId"; this.radTreeView1.CheckedMember = "IsActive"; this.radTreeView1.AutoCheckChildNodes = true; this.radTreeView1.TriStateMode = true; this.radTreeView1.DataSource = items; this.radTreeView1.ExpandAll(); } public class Item { public int Id { get; set; } public string Name { get; set; } public CheckState IsActive { get; set; } public int ParentId { get; set; } public Item(int id, string name, CheckState isActive, int parentId) { this.Id = id; this.Name = name; this.IsActive = isActive; this.ParentId = parentId; } } Workaround: implement a TypeConverter that can handle converting from/to System.Windows.Forms.CheckState. A sample implementation for creating a custom TypeConverter is demonstrated in the following help article: https://docs.telerik.com/devtools/winforms/treeview/data-binding/togglestateconverter
Hello,
I use radbreadcrumb as a group path explorer in my software.
I associate it with a treeview. Please see the attache photos.
When I select a treeviewitem which has too much parent levels, the radbreadcrumb can not display the path completely.
I've tried autoscrollmargin and autoscrollminsize. No luck. Because my radbreadcrumb is in a splitcontainerpanel, the display size is changeable.
I expect a custom function can act like Windows Explorer (see the last attach photo). When there is no enough display space, only the last levels are shown.
PS. I've integrated the telerik solution from this post. And it works great.
https://www.telerik.com/forums/getting-breadcrumb-to-act-like-windows-explorer-breadcrumb
Thank you by advance.
Kun
BUG. RadTreeView throws an exception when an object is being added and delete from its undelying BindingSource
FIX. RadTreeView - the tree should keep its selection, expanded nodes and scroll position when new record is added to its underlying data source
The SelectedNodeChanged event in RadTreeView is fired before the SelectedNodes collection is updated.
To reproduce: please run the attached sample project and follow the steps in the attached sample gif file. Workaround: instead of filtering the nodes, you can manipulate the RadTreeNode.Visible property considering the filter criteria and whether the node contains a child that matches the filter. public RadForm1() { InitializeComponent(); this.radTreeView1.ShowLines = true; } private void FilterNode(RadTreeNode node) { bool atLeastOneChildMatches = false; ChildNodeContains(this.radTextBox1.Text.ToLower(), node.Nodes, ref atLeastOneChildMatches); if (node.Text.ToLower().Contains(this.radTextBox1.Text.ToLower()) || atLeastOneChildMatches) { node.Visible = true; } else { node.Visible = false; } } private void ChildNodeContains(string filterCritria, RadTreeNodeCollection nodes, ref bool atLeastOneChildMatches) { foreach (RadTreeNode node in nodes) { if (node.Text.ToLower().Contains(filterCritria)) { atLeastOneChildMatches = true; return; } if (atLeastOneChildMatches == false && node.Nodes.Count > 0) { ChildNodeContains(filterCritria, node.Nodes, ref atLeastOneChildMatches); } } } private void radTextBox1_TextChanged(object sender, EventArgs e) { PerformFilter(this.radTreeView1.Nodes); } private void PerformFilter(RadTreeNodeCollection nodes) { foreach (RadTreeNode node in nodes) { FilterNode(node); if (node.Nodes.Count > 0) { PerformFilter(node.Nodes); } } }
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);
Copy and paste in RadTreeView does not copies all properties of RadTreeNode.
In RadTreeView, if AllowPlusMinusAnimation property is true and LoadOnDemand is true as well, plus/minus symbols disappears.
The checked state of parent node is incorrect when TriStateMode is enabled and it has a child node with no check type.
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>
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" }); } }
1. Create a new project containing a RadTreeView 2. Add some nodes 3. On a Button.Click event call the Collapse method for the selected node 4. Run the application and click the button
There is a single pixel behind the vertical scrollbar in RadTreeView where the text of long tree nodes is visible.
When the RadTreeView is disabled, nodes text is rendered as bold text.