There is a single pixel behind the vertical scrollbar in RadTreeView where the text of long tree nodes is visible.
Make the editing behavior in RadTreeView to be similar as the one present in windows explorer tree
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); } } }
The background changes to white when clicking an item in RadTreeView and using Office 2010 theme.
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: 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
In RadTreeView, if AllowPlusMinusAnimation property is true and LoadOnDemand is true as well, plus/minus symbols disappears.
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
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")); } }
Scenario: We have an object P which has two lists of child objects of types C1 and C2. If we create a list of P and we try to bind the tree to this list and display the two lists as child nodes, we will not succeed.
RadTreeView. Add node templates as ASP.NET AJAX - http://www.telerik.com/help/aspnet-ajax/treeview-templates-structure.html
Add a possibility to set the auto-expand delay on drag-drop in RadTreeView.
After executing the following code and checking the checkbox of the node, a NullReferenceException is thrown: this.radTreeView1.BeginUpdate(); this.radTreeView1.Nodes.Clear(); radTreeView1.Nodes.Add(new RadTreeNode("name")); this.radTreeView1.EndUpdate();
Workaround: call the ExpandAll method of the tree removing any nodes
FIX RadTreeView - the CheckedNodes property should return the number of the logical checked nodes, not the visual once
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
BringIntoView() does not work on multiselect TreeViews. The property MultiSelect = true
The SelectedNodeChanged event in RadTreeView is fired before the SelectedNodes collection is updated.
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" }); } }
If you set the AllowDragDrop property to true, the node context menu should contains Cut, Copy and Paste items.