Steps to reproduce: 1. Add RadTreeView with few items 2. Apply custom filtering 3. In order to remove the custom filtering and return the default filtering, set the FilterPredicate to null. As a result, it is thrown an exception. Workaround: 1. Save the default filter predicate before applying the custom filtering 2. Clear filter descriptors and set the FilterPredicate property to stored default filter predicate In the attachments can be found a sample application demonstrating the issue and the workaround
1. Place a RadTreeView in a form and add enough items to show scrollbars; 2. Show the form using ShowDialog() and close it 3. Open it again and note that there are no scrollbars in the RadTreeView
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; }
NullReferenceException in the UpdateLines method somehow triggered by the OnProcessMouseUp handler, when I'm trying to perform a drag and drop move in my treeview, that is fully managed by an inner model. The DnD events are bound and trigger delete + add actions in the tree.
The following code produces an error when the user attempts to edit the root node: DataTable dt = new DataTable(); DataColumn column = new DataColumn("ID", typeof(int)); column.AllowDBNull = false; column.AutoIncrement = true; dt.Columns.Add(column); dt.Columns.Add(new DataColumn("ParentID", typeof(int))); dt.Columns.Add(new DataColumn("Name", typeof(string))); dt.Columns.Add(new DataColumn("Note", typeof(string))); dt.Rows.Add(1, DBNull.Value, "Root", "Note1"); dt.Rows.Add(2, 1, "First", "Note1"); dt.Rows.Add(3, 1, "Second", "Note1"); dt.Rows.Add(4, 3, "Third", "Note1"); this.radTreeView1.DisplayMember = "Name"; this.radTreeView1.ParentMember = "ParentID"; this.radTreeView1.ChildMember = "ID"; this.radTreeView1.ValueMember = "ID"; this.radTreeView1.DataSource = dt; radTreeView1.TreeViewElement.EditMode = TreeNodeEditMode.Text; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Telerik.WinControls.UI; namespace Lab.Tree { public partial class TreeSelfreferenceEditRootNodeForm : Form { private RadTreeView treeView = new RadTreeView(); private BindingSource bindingSource = new BindingSource(); public TreeSelfreferenceEditRootNodeForm() { InitializeComponent(); treeView.Dock = DockStyle.Fill; treeView.Parent = this; treeView.AllowEdit = true; DataTable dt = new DataTable(); DataColumn column = new DataColumn("ID", typeof(int)); column.AllowDBNull = false; column.AutoIncrement = true; dt.Columns.Add(column); dt.Columns.Add(new DataColumn("ParentID", typeof(int))); dt.Columns.Add(new DataColumn("Name", typeof(string))); dt.Columns.Add(new DataColumn("Note", typeof(string))); dt.Rows.Add(1, DBNull.Value, "Root", "Note1"); dt.Rows.Add(2, 1, "First", "Note1"); dt.Rows.Add(3, 1, "Second", "Note1"); dt.Rows.Add(4, 3, "Third", "Note1"); bindingSource.DataSource = dt; treeView.DisplayMember = "Name"; treeView.ParentMember = "ParentID"; treeView.ChildMember = "ID"; treeView.ValueMember = "ID"; treeView.DataSource = bindingSource; treeView.TreeViewElement.EditMode = TreeNodeEditMode.Text; } } }
When i have the root nodes loaded, but there are more nodes than fit in the visible area of the treeview, the scrollbar is not automatically shown. I've tried setting the AutoScroll option to true, but that doesn't help.
To reproduce: Add a RadTreeView and a RadBreadCrumb and two RadButtons on the form and populate the tree view with data. Use the following code snippet: private void radButton1_Click(object sender, EventArgs e) { this.radBreadCrumb1.DefaultTreeView = null; } Random rand = new Random(); private void radButton2_Click(object sender, EventArgs e) { this.radTreeView1.DataSource = null; DataTable dt = new DataTable(); dt.Columns.Add("Id"); dt.Columns.Add("Name"); for (int i = 0; i < 10; i++) { dt.Rows.Add(rand.Next(0, 20), "Node" + i); } this.radTreeView1.DataSource = dt; this.radTreeView1.DisplayMember = "Name"; this.radTreeView1.ValueMember = "Id"; this.radBreadCrumb1.DefaultTreeView = this.radTreeView1; } Select some node in RadTreeView, the RadBreadCrum is updated respectively. Then click the first button to detach RadTreeView from RadBreadCrumb. Click the second button to populate RadTreeView with new data and associated the RadBreadCrumb with RadTreeView again. As a result you will notice that the last selected node will be loaded. Workaround: clear the selection in RadTreeView before associating the RadBreadCrumb with RadTreeView: this.radTreeView1.ClearSelection(); this.radBreadCrumb1.DefaultTreeView = this.radTreeView1;
To reproduce: this.radTreeView1.TriStateMode = true; RadTreeNode sitesNode = radTreeView1.Nodes.Add("Sites", "Sites", ""); sitesNode.Expanded = true; RadTreeNode siteNode = new RadTreeNode("A site"); sitesNode.Nodes.Add(siteNode); RadTreeNode eNode = new RadTreeNode("Event Types"); siteNode.Nodes.Add(eNode); siteNode.Expanded = true; RadTreeNode dummy = new RadTreeNode("dummy"); eNode.Nodes.Add(dummy); dummy.CheckState = ToggleState.On; RadTreeNode dummy2 = new RadTreeNode("dummy2"); eNode.Nodes.Add(dummy2); dummy2.CheckState = ToggleState.Off; Please refer to the attached screenshot. Workaround: change the CheckState property after all nodes are added to RadTreeView. this.radTreeView1.TriStateMode = true; RadTreeNode sitesNode = radTreeView1.Nodes.Add("Sites", "Sites", ""); sitesNode.Expanded = true; RadTreeNode siteNode = new RadTreeNode("A site"); sitesNode.Nodes.Add(siteNode); RadTreeNode eNode = new RadTreeNode("Event Types"); siteNode.Nodes.Add(eNode); siteNode.Expanded = true; RadTreeNode dummy = new RadTreeNode("dummy"); eNode.Nodes.Add(dummy); RadTreeNode dummy2 = new RadTreeNode("dummy2"); eNode.Nodes.Add(dummy2); dummy2.CheckState = ToggleState.Off; dummy.CheckState = ToggleState.On;
SelectedNodeChanged event not owrk properly during remove operation of SelectedNode
Please refer to the attached gif file. Workaround: set the Enabled property to false at run time.
To reproduce: add a RadTreeView and a RadButton to the form. Use the following code snippet: public Form1() { InitializeComponent(); RadTreeNode node1 = new RadTreeNode(); node1.Text = "SameText"; RadTreeNode node2 = new RadTreeNode(); node2.Text = "SameText"; this.radTreeView1.Nodes.Add(node1); this.radTreeView1.Nodes.Add(node2); this.radTreeView1.SortOrder = SortOrder.Ascending; } private void radButton1_Click(object sender, EventArgs e) { for (int i = this.radTreeView1.Nodes.Count - 1; i > -1; i--) { this.radTreeView1.Nodes.RemoveAt(i); } } Workaround: set the SortOrder property to None before removing the nodes and restore it afterwards private void radButton1_Click(object sender, EventArgs e) { this.radTreeView1.SortOrder = SortOrder.None; for (int i = this.radTreeView1.Nodes.Count - 1; i > -1; i--) { this.radTreeView1.Nodes.RemoveAt(i); } this.radTreeView1.SortOrder = SortOrder.None; }
Repro-steps:
Observed behavior:
Expected behavior:
Applied Font Styles for every Node not loaded correctly - all have a defaul value
Steps to reproduce the issue:
1. Run the example app.
2. Click undo (the last item is removed).
3. Click redo (the last item should be added to the Treeview, it does not)
If I run the application and click undo twice and then redo twice, the things work. The Treeview is not updated if I add and remove the same element instance to the binding list.
Workaround: rebind the treeview after redo or create a new instance of the Element class with the same name and id.
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; } }
If you have a node with a very long text that requires horizontal scrollbar and at the same time you have a many nodes which requires a vertical scrollbar in some border cases the long text of the node is cut off (with ellipsis).
When you set a new localization provider to RadTreeView, the strings of the nodes' context menu are not changed
RadTreeView should be able to bind to subproperties.
1. Set the AllowArbitraryItemHeight property of a RadTreeView to true 2. Open the RadTreeView Property Builder for that RadTreeView 3. Add an item to the root 4. Click on the item 5. Click on advanced 6. Set the ItemHeight to a custom value (e.g. 40) 7. Click apply 8. Reopen the Property Builder - you will notice that the ItemHeight value is reset.