it appears to work okay on android, but I can't use it from an ipad
To reproduce: add a hierarchical RadTreeView with several levels. Use the RadTreeNode.Expanded property in order to expand a child node from the bottom levels. Ensure that all parent nodes up to the top are expanded as well. When you run the application, the vertical scroll bar is not displayed. Sub New() InitializeComponent() Me.Size = New Size(234, 188) Dim dt As New DataTable dt.Columns.Add("Id", GetType(String)) dt.Columns.Add("ParentId", GetType(String)) dt.Columns.Add("Name", GetType(String)) Dim uniqueId As String = Guid.NewGuid().ToString() dt.Rows.Add(uniqueId, Nothing, "Node.1") For index = 2 To 5 Dim subUniqueId As String = Guid.NewGuid().ToString() dt.Rows.Add(subUniqueId, uniqueId, "SubNode.1." & index) If index Mod 2 = 0 Then For index2 = 6 * index To 6 * index + 5 Dim subSubUniqueId As String = Guid.NewGuid().ToString() dt.Rows.Add(subSubUniqueId, subUniqueId, "SubSubNode.1." & index & "." & index2) For index3 = 12 * index To 12 * index + 3 Dim subSubSubUniqueId As String = Guid.NewGuid().ToString() dt.Rows.Add(subSubSubUniqueId, subSubUniqueId, "SubSubSubNode.1." & index & "." & index2 & "." & index3) Next Next End If Next Me.RadTreeView1.DataSource = dt Me.RadTreeView1.DisplayMember = "Name" Me.RadTreeView1.ValueMember = "Id" Me.RadTreeView1.RelationBindings.Add(New RelationBinding(dt, "Name", "ParentId", "Id", "Id")) End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim nodeTextToExpand = "SubSubNode.1.4.27" Dim nodeToExpand = Me.RadTreeView1.GetNodeByName(nodeTextToExpand) If nodeToExpand IsNot Nothing Then Expand(nodeToExpand) End If End Sub Private Sub Expand(nodeToExpand As RadTreeNode) nodeToExpand.Expanded = True If nodeToExpand.Parent IsNot Nothing Then Expand(nodeToExpand.Parent) End If End Sub Workaround: start expanding the nodes from the top most level to the bottom most level: Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim nodeTextToExpand = "SubSubNode.1.4.27" Dim nodeToExpand = Me.RadTreeView1.GetNodeByName(nodeTextToExpand) If nodeToExpand IsNot Nothing Then Expand(nodeToExpand) End If While (nodes.Count > 0) nodes.Pop().Expanded = True End While End Sub Dim nodes As New Stack(Of RadTreeNode) Private Sub Expand(nodeToExpand As RadTreeNode) nodes.Push(nodeToExpand) If nodeToExpand.Parent IsNot Nothing Then Expand(nodeToExpand.Parent) End If End Sub
To reproduce use the following function to reset the data source of the treeview public void LoadObjects() { radBreadCrumb1.DefaultTreeView = null; tvObjects.DataSource = null; tvObjects.DataSource = GetTable(); tvObjects.DisplayMember = "Name"; tvObjects.ValueMember = "Name"; radBreadCrumb1.DefaultTreeView = tvObjects; } Workaround: public void LoadObjects() { radBreadCrumb1.DefaultTreeView = null; MethodInfo mi = typeof(RadBreadCrumb).GetMethod("value_Selected", BindingFlags.Instance | BindingFlags.NonPublic); Delegate delegateToRemove = Delegate.CreateDelegate(typeof(RadTreeView.RadTreeViewEventHandler), this.radBreadCrumb1, mi); this.tvObjects.TreeViewElement.SelectedNodeChanged -= (RadTreeView.RadTreeViewEventHandler)delegateToRemove; mi = typeof(RadBreadCrumb).GetMethod("value_NodeExpand", BindingFlags.Instance | BindingFlags.NonPublic); delegateToRemove = Delegate.CreateDelegate(typeof(RadTreeView.TreeViewEventHandler), this.radBreadCrumb1, mi); this.tvObjects.TreeViewElement.NodeExpandedChanged -= (RadTreeView.TreeViewEventHandler)delegateToRemove; tvObjects.DataSource = null; tvObjects.DataSource = GetTable(); tvObjects.DisplayMember = "Name"; tvObjects.ValueMember = "Name"; radBreadCrumb1.DefaultTreeView = tvObjects; }
To reproduce: 1.Add a RadTreeView and four RadButton controls. 2.Use the following code snippet: private Random random = new Random(); public Form1() { InitializeComponent(); radTreeView1.AutoSize = true; radTreeView1.TreeViewElement.HorizontalScrollState = ScrollState.AlwaysHide ; radTreeView1.TreeViewElement.DrawBorder = false; } private string NextText() { char[] letters = new char[random.Next(4, 11)]; for (int i = 0; i < letters.Length; ++i) { letters[i] = (char)random.Next('a', 'z' + 1); } letters[0] = char.ToUpper(letters[0]); return new string(letters); } private RadTreeNodeCollection GetRandomNodeCollection() { if (radTreeView1.Nodes.Count == 0) { return radTreeView1.Nodes; } int depth = random.Next(MaxDepth(radTreeView1.Nodes)); var source = radTreeView1.Nodes; while ((depth--) >= 0 && source.Count > 0) { source = source[random.Next(source.Count)].Nodes; } return source; } private static int MaxDepth(RadTreeNodeCollection nodes, int currentDepth = 0) { if (nodes.Count == 0) { return currentDepth; } int max = -1; foreach (var n in nodes) { max = Math.Max(MaxDepth(n.Nodes, currentDepth + 1), max); } return max; } private void UpdateTree(bool clearNodes) { radTreeView1.BeginUpdate(); if (clearNodes) { radTreeView1.Nodes.Clear(); } else { bool makeRoot = false; int count = random.Next(10, 50); for (; count > 0; --count) { makeRoot = random.NextDouble() < 0.23456789; var nodes = makeRoot ? radTreeView1.Nodes : GetRandomNodeCollection(); nodes.Add(NextText()); } } radTreeView1.EndUpdate(); radTreeView1.ExpandAll(); } private void radButton1_Click(object sender, EventArgs e) { UpdateTree(false); } private void radButton2_Click(object sender, EventArgs e) { UpdateTree(true); } private void radButton3_Click(object sender, EventArgs e) { radTreeView1.ExpandAll(); } private void radButton4_Click(object sender, EventArgs e) { radTreeView1.CollapseAll(); } Workaround: instead of clearing nodes, remove one by one: //radTreeView1.Nodes.Clear(); while (radTreeView1.Nodes.Count > 0) { radTreeView1.Nodes.Last().Remove(); }
Workaround: use the NodeFormatting event to set the NodeElement.ExpanderElement.Padding to new Padding(1, 0, 0, 0)
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: 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
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.
Select Demo application >> "Tree View" -> "Drag & Drop". Focus on the left treeview. 1. Click on the node "Drafts"; 2. Press Shift button and click on the "Outbox" node; 3. Release shift button; 4. Press left mouse button on the "Outbox" node and start dragging; 5. Drop selected nodes after node "Large Mail". You can see that order of nodes was changed. Before: "Drafts", "Inbox" and "Outbox" After: "Outbox", "Drafts" and "Inbox" Possible workaround: http://www.telerik.com/forums/nodes-order-after-drag-drop#5bbz6cBDEUeHLyLU5zkfDQ
Similar functionality like in KendoUI or WPF
To reproduce: 1. Run Demo application >> TreeView >> Drag & Drop. 2. Change the theme to Windows7 and start dragging a node. The drop hint is missing. Workaround: apply the theme in the Form.Load event after getting the TreeViewElement.ItemDropHint property coming from the ControlDefault theme. RadImageShape hint; private void Form1_Load(object sender, EventArgs e) { hint = this.radTreeView1.TreeViewElement.ItemDropHint; this.radTreeView1.ThemeName = "Windows7"; this.radTreeView1.TreeViewElement.ItemDropHint = hint; }
Workaround: class CustomDragDropService : TreeViewDragDropService { public CustomDragDropService(RadTreeViewElement owner) : base(owner) { } protected override void SetHintWindowPosition(Point mousePt) { } } class CustomTreeViewElement : RadTreeViewElement { protected override Type ThemeEffectiveType { get { return typeof(RadTreeViewElement); } } protected override TreeViewDragDropService CreateDragDropService() { return new CustomDragDropService(this); } } class CustomTreeView : RadTreeView { protected override RadTreeViewElement CreateTreeViewElement() { return new CustomTreeViewElement(); } public override string ThemeClassName { get { return typeof(RadTreeView).FullName; } } }
Workaround: private void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e) { e.NodeElement.UseDefaultDisabledPaint = true; }
To reproduce: 1. Add a RadTreeView with several nodes 2. Subscribe to the EditorRequired event and specify the editor to TreeViewTextBoxEditor where its Multiline property is set to true. 3. Select a node and press F2. The editor is activated. However, when you enter some text and press Ctrl+Enter, the editor is closed. The expected behavior is that a new line is inserted. Workaround: private void radTreeView1_EditorRequired(object sender, TreeNodeEditorRequiredEventArgs e) { CustomTreeViewTextBoxEditor editor = new CustomTreeViewTextBoxEditor(); editor.Multiline = true; e.Editor = editor; } public class CustomTreeViewTextBoxEditor : TreeViewTextBoxEditor { protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Enter && e.Modifiers == Keys.Control && this.Multiline) { return; } base.OnKeyDown(e); } }
To reproduce: Bind the tree to the following structure: public class DeskSites { public string DeskSiteName { get; set; } public Channels channels { get; set; } } public class Channels : List<Channel> { } public class Channel { public string ChannelName { get; set; } public FileSets fileSets { get; set; } } public class FileSets : List<FileSet> { } public class FileSet { public string FileSetName { get; set; } } Workaround: Use the the generic class instead of the inherited one: public class DeskSites { public string DeskSiteName { get; set; } public List<Channel> channels { get; set; } }
To reproduce: 1. Drag and drop RadTreeView on the form. 2. Set the Dock property to true 3. Add 3 or more nodes with long names 4. Resize the form to minimum size and you will notice that the spacing between characters is changed. Workaround: If FontSize of nodes is bigger than 13, you can subscribe to the NodeFormatting event and set the AutoEllipsis property to false: Font font = new Font("Segoe UI", 13f, FontStyle.Regular); void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e) { e.NodeElement.ContentElement.Font = font; e.NodeElement.ContentElement.AutoEllipsis = false; } If font size is smaller, you need to set the MinSize property too: Font font = new Font("Segoe UI", 12f, FontStyle.Regular); void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e) { e.NodeElement.ContentElement.Font = font; e.NodeElement.ContentElement.MinSize = new System.Drawing.Size(500, 18); }
To reproduce: public Form1() { InitializeComponent(); this.radTreeView1.AllowDragDrop = true; this.radTreeView2.AllowDragDrop = true; for (int i = 0; i < 5; i++) { this.radTreeView1.Nodes.Add("Node1." + i); this.radTreeView2.Nodes.Add("Node2." + i); } this.radTreeView1.ScreenTipNeeded += radTreeView1_ScreenTipNeeded; this.radTreeView2.ScreenTipNeeded += radTreeView1_ScreenTipNeeded; } RadOffice2007ScreenTipElement _screenTip = new RadOffice2007ScreenTipElement(); private void radTreeView1_ScreenTipNeeded(object sender, Telerik.WinControls.ScreenTipNeededEventArgs e) { _screenTip.CaptionLabel.Text = "Caption"; _screenTip.MainTextLabel.Text = "text"; _screenTip.AutoSize = true; e.Delay = 2000; e.Item.ScreenTip = _screenTip; } Steps: 1. Drag a node from the first RadTreeView to the other while the screen-tip is shown for the dragged node. 2. When the screen-tip is about to be hidden, the error occurs. Workaround: private void radTreeView1_DragStarting(object sender, RadTreeViewDragCancelEventArgs e) { if (_screenTip.IsElementVisible) { this.radTreeView1.Behavior.HideScreenTip(); } }