If you set the RadBreadCrumb.DefaultTreeView property to null, all items in the RadBreadCrumb should be cleared. Additionally, the subscription to the SelectedNodeChanged remains although the associated tree view is set to null. Afterwards, if you change the selected node, a NullReferenceException occurs.
To reproduces: add a RadTreeView and set up Object-relational hierarchy. Use the following code: NorthwindEntities context = new NorthwindEntities(); public Form1() { InitializeComponent(); context.Categories.Load(); context.Products.Load(); this.radTreeView1.DataSource = context.Categories.Local.ToBindingList(); this.radTreeView1.DisplayMember = "CategoryName\\ProductName"; this.radTreeView1.ChildMember = "Categories\\Products"; } private void radButton1_Click(object sender, EventArgs e) { this.radTreeView1.ChildMember = "Products\\Categories"; this.radTreeView1.DisplayMember = "ProductName\\CategoryName"; this.radTreeView1.DataSource = context.Products.Local.ToBindingList(); } When you click the RadButton, NullReferenceException occurs. Resolution: Add more descriptive exception message.
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; } } }
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 = true; radTreeView1.ShowExpandCollapse = false; radTreeView1.ShowLines = true; } WORKAROUND: void radTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e) { if (radTreeView1.ShowExpandCollapse == false && radTreeView1.ShowRootLines == true) { if (e.Node.Parent == null && e.Node.Nodes.Count >0) { TreeNodeLineElement lineElement = (TreeNodeLineElement)e.NodeElement.LinesContainerElement.Children[0]; lineElement.Visibility = ElementVisibility.Visible; if (e.Node.Index==0) { lineElement.Type = TreeNodeLineElement.LinkType.RightTopAngleShape; } else if (e.Node.Index == radTreeView1.Nodes.Count -1) { lineElement.Type = TreeNodeLineElement.LinkType.RightBottomAngleShape; } } } }
1. Create a new project with RadTreeView 2. Handle the NodeCheckedChanged event 3. Call the ExpandAll method for the checked node when handling this event 4. Run the project and check the first node
To reproduce: 1. Add a RadTreeView and populate it with nodes at design time. 2. Use the following code snippet: Me.RadTreeView1.AllowDefaultContextMenu = True Me.RadTreeView1.RightToLeft = Windows.Forms.RightToLeft.Yes When you run the application and right click over a node, the context menu is not in RTL mode. Workaround: use the ContextMenuOpening event and set the TreeViewDefaultContextMenu.RightToLeft property to Yes. Private Sub RadTreeView1_ContextMenuOpening(sender As Object, e As TreeViewContextMenuOpeningEventArgs) _ Handles RadTreeView1.ContextMenuOpening Dim defaultMenu As TreeViewDefaultContextMenu = TryCast(e.Menu, TreeViewDefaultContextMenu) If defaultMenu IsNot Nothing Then defaultMenu.DropDown.RightToLeft = Windows.Forms.RightToLeft.Yes End If End Sub
Workaround: class MyTreeView : RadTreeView { protected override RadTreeViewElement CreateTreeViewElement() { return new MyTreeViewElement(); } public override string ThemeClassName { get { return typeof(RadTreeView).FullName; } } } class MyTreeViewElement : RadTreeViewElement { bool IsPerformingEndEdit = false; protected override bool EndEditCore(bool commitChanges) { if (!IsEditing || IsPerformingEndEdit) { return false; } TreeNodeElement nodeElement = GetElement(this.SelectedNode); if (nodeElement == null) { return false; } this.IsPerformingEndEdit = true; if (commitChanges && this.ActiveEditor.IsModified) { SaveEditorValue(nodeElement, this.ActiveEditor.Value); } this.ActiveEditor.EndEdit(); nodeElement.RemoveEditor(this.ActiveEditor); this.InvalidateMeasure(); UpdateLayout(); OnEdited(new TreeNodeEditedEventArgs(nodeElement, ActiveEditor, !commitChanges)); typeof(RadTreeViewElement).GetField("activeEditor", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).SetValue(this, null); this.IsPerformingEndEdit = false; return false; } protected override Type ThemeEffectiveType { get { return typeof(RadTreeViewElement); } } }
I can type to select a node. For example, if I click to select the Car node, then type "V", selection jumps to the "Van" node. I can right-arrow to expand, then type "U" to select the "Useful" node. Resolution: Added two new properties: KeyboardSearchEnabled and KeyboardSearchResetInterval. When set the KeyboardSearchEnabled property to true, user can navigate to an item by typing when RadTreeView is focused. You can set how long the user must wait before searching with the keyboard is reset using the KeyboardSearchResetInterval property.
it appears to work okay on android, but I can't use it from an ipad
RadTreeView - Traverser throws exception if you clear and recreate all sub nodes of some node. Steps to reproduce: 1. Create RadTreeView with one node. 2. Add 100 sub nodes. 3. Clear the sub nodes. 4. Move scroll. WorkAround: private void RefreshNodes() { radTreeView1.BeginUpdate(); this.radTreeView1.TreeViewElement.Scroller.Traverser.Position = groupNode; this.radTreeView1.TreeViewElement.Scroller.Traverser.Reset(); this.radTreeView1.SelectedNodes.Clear(); groupNode.Nodes.Clear(); AddNodes(groupNode.Nodes, 1, 100); groupNode.Expand(); radTreeView1.EndUpdate(); this.radTreeView1.TreeViewElement.Update(RadTreeViewElement.UpdateActions.Reset); }
To reproduce : add a RadTreeView with several nodes and use the following code snippet: this.radTreeView1.AllowDragDrop = true; this.TopMost = true; Note that dragging a node will no longer display the "DropHint" line. Workaround: class CustomDragDropService : TreeViewDragDropService { public CustomDragDropService(RadTreeViewElement owner) : base(owner) { } protected override void UpdateHintPosition(Point mousePosition) { FieldInfo fi = typeof(TreeViewDragDropService).GetField("dropHintWindow", BindingFlags.NonPublic | BindingFlags.Instance); RadLayeredWindow window = fi.GetValue(this) as RadLayeredWindow; window.TopMost = true; base.UpdateHintPosition(mousePosition); } } class CustomTreeViewElement : RadTreeViewElement { //Enable themeing for the element protected override Type ThemeEffectiveType { get { return typeof(RadTreeViewElement); } } //Replace the default drag drop service with the custom one protected override TreeViewDragDropService CreateDragDropService() { return new CustomDragDropService(this); } } 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; } } }
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.
Adding or removing node through BindingList API collapse all nodes in self-referencing hierarchy in RadTreeView.
If you perform radTreeView.Nodes.Clear method and then load new nodes by using the LoadXML method, the drag and drop behavior is corrupted.
The RadTreeView throws exception when the BindingSource.CancelEdit is invoked.
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; } } }
When the RadTreeView is disabled, nodes text is rendered as bold text.
The SelectedNodes collection is not cleared, when the clear all nodes in single selection mode.
The node find methods of RadTreeView should not perform over the inernal RootTreeNode.