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; }
The GetNodeByName method will return a node with the specified name
There should be a convenient way to hide the expander icon and to show lines when using full lazy mode.
Summary of the program logic: The app allows the user to edit hierarchical data that is serialized/deserialized from an XML file. It is first deserialized into a collection of business objects that are structured hierarchically: MetadataNode --LongNameEnglish::string --LongNameArabic::string --Nodes::BindingList<MetadataNode> I take this hierarchical collection and flatten it out so that each node references the Id of its parent node (self-referencing): --Node 1 (Id:1, ParentId:null) ----Node 1-1 (Id:2, ParentId:1) ----Node 1-2 (Id:3, ParentId:1) In the attached project, if you run it and select File->Open Data File and browse to and select the Metadata2.xml file that I included in the root of the ZIP archive, then click the add button (the icon with the "+" symbol on top of the treeview control), the code in the AddNode function works as expected--it calls RadTreeView.BeginUpdate(), adds a new item to the datasource (a BindingList<MetadataNode> collection), then calls RadTreeView.EndUpdate(). However, if you run the application and select File->New Data File and click the add button, the same code throws a NullReferenceException when the RadTreeView.EndUpdate() method is called.
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.
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.
SelectedNodeChanged event not owrk properly during remove operation of SelectedNode
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; } } }
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
Sort the selected nodes according to their position in the tree
Workaround: Instead of {RadTreeNode}.Nodes.Clear(), use while ({RadTreeNode}.Nodes.Count>0) { {RadTreeNode}.Nodes.RemoveAt(0); }
Workaround: RadTreeView1.TreeViewElement.TreeNodeProvider.Reset()
FIX. RadTreeView - CreateNode event is not fired when adding a node from the New menu item in the context menu Workaround: Use the NodeAdding/NodeAdded events.
The event is fired then drag and drop is performed in unbound mode but not when in bound mode
bind the tree and try to add a node to the control - error occurs
To reproduce: public Form1() { InitializeComponent(); DataTable table = new DataTable(); table.Columns.Add("ID"); table.Columns.Add("Name"); for (int i = 0; i < 10; i++) {
To reproduce, use the following code. Once the app starts, expand nodes 1, 5,10, 15 and 19. Scroll to the very bottom and filter the tree: public partial class Form1 : RadForm { public Form1() { InitializeComponent();
To reprodice: for (int i = 0; i < 20; i++) { RadTreeNode node = new RadTreeNode("Node " + i); node.ToolTipText = "hello " + i; radTreeView1.Nodes.Add(node); }
Start dragging a node and scroll using the mouse wheel. While scrolling, drop the node.
To reproduce: protected override void OnLoad(EventArgs e) { base.OnLoad(e); radTreeView1 = new RadTreeView(); radTreeView1.Parent = this; for (int i = 0; i < 5; i++) { RadTreeNode n1 = new RadTreeNode("Node" + i); this.radTreeView1.Nodes.Add(n1); if (i % 2 == 0) { for (int j = 0; j < 2; j++) { RadTreeNode n2 = new RadTreeNode("Node" + i + "." + j); n1.Nodes.Add(n2); if (j % 2 == 0) { for (int k = 0; k < 2; k++) { RadTreeNode n3 = new RadTreeNode("Node" + i + "." + j + "." + k); n2.Nodes.Add(n3); } } } } } radTreeView1.ShowRootLines = false; radTreeView1.ShowLines = false; } Workaround: void radTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e) { if (radTreeView1.ShowLines == false) { if (e.NodeElement.LinesContainerElement.Children.Count > 0) { TreeNodeLineElement lineElement = (TreeNodeLineElement)e.NodeElement.LinesContainerElement.Children[0]; lineElement.Visibility = ElementVisibility.Collapsed; } } }