To reproduce: this issue is reproducible under Windows8 OS only -add RadTreeView from the Toolbox to the Form and add several tree nodes at design time; -add RadContextMenu from the Toolbox and add several items at design time; Use the following code: public Form1() { InitializeComponent(); this.radTreeView1.RadContextMenu = this.radContextMenu1; } -run the application; -select a tree node; -right mouse click over the node to show the context menu; As a result the main form looses focus and you are unable to click anywhere outside the RadTreeView. This issue is inconstant and it is not appearing every time. Workaround: use ContextMenu property instead: public Form1() { InitializeComponent(); ContextMenu menu = new ContextMenu(); foreach (var item in radContextMenu1.Items) { menu.MenuItems.Add(new MenuItem(item.Text)); } this.radTreeView1.ContextMenu = menu; // this.radTreeView1.RadContextMenu = this.radContextMenu1; }
To reproduce: -add RadTreeView and RadButton: -use the following code: public partial class Form1 : Form { public Form1() { InitializeComponent(); List<Distributor> distributors = new List<Distributor>() { new Distributor(432,"Distributor 1"), new Distributor(454,"Distributor 2"), new Distributor(438,"Distributor 3"), new Distributor(455,"Distributor 4") }; List<Distributor> distributors2 = new List<Distributor>() { new Distributor(486,"Distributor 5"), new Distributor(487,"Distributor 6"), new Distributor(498,"Distributor 7"), new Distributor(475,"Distributor 8") }; List<Product> products = new List<Product>(); products.Add(new Product(567, "Bicycle", 5, distributors)); products.Add(new Product(456, "Car", 5000,distributors2)); products.Add(new Product(789, "Bike", 1500,null)); BindingList<Category> categories = new BindingList<Category>(); categories.Add(new Category("Bikes", products)); categories.Add(new Category("Accessories", null)); categories.Add(new Category("Clothing", null)); radTreeView1.DataSource = categories; if ((radTreeView1.DataSource as BindingList<Category>).Count > 0) { radTreeView1.DisplayMember = "Name\\Description\\Name"; radTreeView1.ChildMember = "Categories\\Products\\Distributors"; } } private void radButton1_Click(object sender, EventArgs e) { BindingList<Category> categories = radTreeView1.DataSource as BindingList<Category>; categories.Clear(); } } public class Distributor { private int _id; private string _name; public Distributor(int id, string name) { this._id = id; this._name = name; } public int Id { get { return this._id; } set { this._id = value; } } public string Name { get { return this._name; } set { this._name = value; } } } public class Product { private int _id; private string _description; private float _price; private List<Distributor> _distributors; public List<Distributor> Distributors { get { return this._distributors; } set { this._distributors = value; } } public int ID { get { return _id; } set { _id = value; } } public string Description { get { return _description; } set { _description = value; } } public float Price { get { return _price; } set { _price = value; } } public Product(int id, string description, float price, List<Distributor> distributors) { _id = id; _description = description; _price = price; _distributors = distributors; } } public class Category { public Category(string name, List<Product> products) { _name = name; _products = products; } private List<Product> _products; private string _name; public string Name { get { return _name; } set { _name = value; } } public List<Product> Products { get { return _products; } set { _products = value; } } } When you click the button, ArgumentOutOfRangeException is thrown. Workaround: instead of clearing the BindingList, remove each list item one by one: while (categories.Count>0) { categories.RemoveAt(0); }
Add e.Action in SelectedNodeChanging similar to the one in the standard TreeView.BeforeSelect event which indicates what caused the event - mouse click, key pressed, or other
FIX. RadTreeView - exception while filtering a tree scrolled to the bottom end point
To reproduce: for (int i = 0; i < 10; i++) { RadTreeNode node = new RadTreeNode("Node " + i); radTreeView1.Nodes.Add(node); node.Style.GradientStyle = GradientStyles.Solid; node.Style.BackColor = System.Drawing.Color.LightCoral; } Workaround: use NodeFormatting
FIX. RadTreeView SelectedNodeChanged is fired even when you click outside the node with disabled FullRowSelect
FIX. RadTreeView throws exception when node text is changed to empty string in bound mode
RadTreeView arrow keys navigation is not correct in RTL mode. It should expand with left key and collapse with right key (the opposite of normal mode)
Workaround: this.radTreeView1.SelectedNode = null;
To reproduce: - populate a tree with some nodes in different levels - set the ShowLines to true - select a node on the second level - clear the nodes on a button click => exception is thrown WORKAROUND: radTreeView1.ShowLines = false; radTreeView1.Nodes.Clear(); radTreeView1.ShowLines = true;
Please refer to the attached gif files illustrating the working and non working design time data binding.
FIX. RadTreeView - updating a field in the DataBoundItem of a node is not automatically reflected
To reproduce: void radTreeView1_EditorInitialized(object sender, TreeNodeEditorInitializedEventArgs e) { TreeViewTextBoxEditor editor = e.Editor as TreeViewTextBoxEditor; BaseTextBoxEditorElement element = (BaseTextBoxEditorElement)editor.EditorElement; element.TextChanging+=new TextChangingEventHandler(element_TextChanging); } void element_TextChanging(object sender, TextChangingEventArgs e) { e.Cancel = true; }
To reproduce use this code: RadTreeView tree = new RadTreeView(); tree.Name = "tree"; RadTreeNode[] nodes = new RadTreeNode[5]; for (int i = 0; i < nodes.Length; ++i) nodes[i] = new RadTreeNode(i.ToString()); tree.Nodes.AddRange(nodes); tree.Nodes.Clear(); tree.Nodes.AddRange(nodes);
To reproduce: Add nodes to RadTreeView with at least 3 levels hierarchy. Set some of the last level nodes Visible property to false. Start the application. Expand some nodes and scroll. You will notice that the last item will change sometimes. Workaround: Set this.radTreeView1.TreeViewElement.AllowArbitraryItemHeight = true; Use ItemHeight = 1, instead of Visible = false
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; } } } }
Add a RadTreeView with several hierarchy levels. Initially all nodes are collapsed. When you collapse each child node deeper in the hierarchy, use the following code snippet: public Form1() { InitializeComponent(); radTreeView1.CollapseAll(); radTreeView1.TreeViewElement.AutoScrollOnClick = false; } private void radTreeView1_NodeExpandedChanged(object sender, RadTreeViewEventArgs e) { if (e.Node.Expanded) { e.Node.LastNode.EnsureVisible(); radTreeView1.BringIntoView(e.Node.LastNode); } } The last child node is visible, regarding the height, however, the entire node is not visible, regarding the width. Workaround: use RadTreeView.MouseUp event instead. private void radTreeView1_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { TreeNodeExpanderItem expander = radTreeView1.ElementTree.GetElementAtPoint(e.Location) as TreeNodeExpanderItem; if (expander != null && expander.Expanded && expander.NodeElement.Data != null) { radTreeView1.BringIntoView(expander.NodeElement.Data.LastNode); } } }
The disabling of the scroll bars is broke as shit. I have tried rtvDrainage.HorizontalScroll.Visible = false; rtvDrainage.HorizontalScroll.Maximum = 0; rtvDrainage.HorizontalScroll.Enabled = false; rtvDrainage.AutoScroll = false; rtvDrainage.EnableDeferredScrolling = false; rtvDrainage.EnableKineticScrolling = false; rtvDrainage.HScrollBar.Maximum = 0; rtvDrainage.HScrollBar.Visibility = Telerik.WinControls.ElementVisibility.Collapsed; NOTHING stops this damn thing from showing up (i put this in both the load and in a button to hit after loading) 2 hours wasted trying to make a scroll bar not show up.........
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; } } }
To reproduce: Add some notes to RadTreeView. Set the Font as follows in the NodeFormatting event: Font font = new Font("Tahoma", 13f); void tree_NodeFormatting(object sender, TreeNodeFormattingEventArgs e) { e.NodeElement.ContentElement.Font = font; } Start the project on Windows 7 or Vista with ClearType off and you will see that the font is thick. Workaround: Use the following node element: public class MyTreeNodeElement : TreeNodeElement { protected override TreeNodeContentElement CreateContentElement() { return new MyTreeNodeContentElement(); } protected override Type ThemeEffectiveType { get { return typeof(TreeNodeElement); } } } public class MyTreeNodeContentElement : TreeNodeContentElement { protected override void PrePaintElement(Telerik.WinControls.Paint.IGraphics graphics) { base.PrePaintElement(graphics); Graphics g = graphics.UnderlayGraphics as Graphics; if (g == null) { return; } if (this.Enabled) { g.TextRenderingHint = this.TextRenderingHint; } else { g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; } } } void tree_CreateNodeElement(object sender, CreateTreeNodeElementEventArgs e) { e.NodeElement = new MyTreeNodeElement(); } And set the TextRenderingHint of the ContentElement: Font font = new Font("Tahoma", 13f); void tree_NodeFormatting(object sender, TreeNodeFormattingEventArgs e) { e.NodeElement.ContentElement.Font = font; e.NodeElement.ContentElement.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; }