Pressing arrow down or up when renaming item on a list with scrollbar throws null pointer exception. Example solution in attachement. Steps to reproduce with attached solution: Scroll down to last element (A99) Press F2 (rename) and rename to "0" Press arrow up or down on a keyboard (without pressing enter after rename). -> NullReferenceException is thrown.
Please refer to the attached screenshot from the Demo application >> General Settings example. Workaround: private void radTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e) { e.NodeElement.ExpanderElement.Margin = new Padding(2, 0, 0, 0); }
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;
Please refer to the attached gif file and sample project. The screen tip position is not the same each time. Hence, the issue may not be reproducible every time. Workaround: use the TooltiptextNeeded event.
Please refer to the attached gif files illustrating the working and non working design time data binding.
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: 1. Add a RadTreeView and a RadBreadCrumb. Associated the breadcrumb with the tree. 2. Select a node and use the following code: this.radBreadCrumb1.DefaultTreeView.Nodes.Clear(); Workaround: set the RadBreadCrumb.DefaultTreeView property to null.
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
To reproduce: - Add a lot of nodes to the tree (scrollbars must appear). - Use the following code to add nodes: public RadForm1() { InitializeComponent(); radTreeView1.AllowEdit = true; RadContextMenu menu = new RadContextMenu(); RadMenuItem add = new RadMenuItem(); add.Click += add_Click; add.Text = "add"; menu.Items.Add(add); radTreeView1.RadContextMenu = menu; } void add_Click(object sender, EventArgs e) { RadTreeNode node = radTreeView1.SelectedNode; var newNode = node.Nodes.Add("new node"); node.Expanded = true; radTreeView1.SelectedNode = newNode; radTreeView1.BeginEdit(); } - Add a node and scroll Workaround: public RadForm1() { InitializeComponent(); radTreeView1.TreeViewElement.VScrollBar.Scroll += VScrollBar_Scroll; radTreeView1.MouseWheel += TreeViewElement_MouseWheel; } void TreeViewElement_MouseWheel(object sender, MouseEventArgs e) { var radTreeView = sender as RadTreeView; if (radTreeView.IsEditing) { radTreeView.EndEdit(); } } void VScrollBar_Scroll(object sender, ScrollEventArgs e) { var radTreeView = (sender as RadScrollBarElement).ElementTree.Control as RadTreeView; if (radTreeView.IsEditing) { radTreeView.EndEdit(); } }
Workaround: raise a flag before the delete operation and cancel the SelectedNodeChanging event
Start dragging a node and scroll using the mouse wheel. While scrolling, drop the node.
Please refer to the attached sample project and follow the steps: If you execute my code sample and try this sequence, you will see my problem: 1- start the application 2- select "test1" on the grid => you see "fonction XX of test1" in the treeview (that's correct) 3- select "test2" on the grid => you see "fonction XX of test2" in the treeview (that's correct) 4- expand all nodes in the treeview 5- uncheck "fonction 31 of test2" in the treeview 6- select "test1" on the grid => you have the error message. On the grid, we have "test1" selected and on the treeview we have "test2". Note that the problem appears only when checking a node in the treeview on a second level. If you follow this procedure, you will have no problem : 1- restart the application 2- select "test1" on the grid => you see "fonction XX of test1" in the treeview (that's correct) 3- select "test2" on the grid => you see "fonction XX of test2" in the treeview (that's correct) 4- uncheck "fonction 30 of test2" in the treeview 5- select "test1" on the grid => you will have no error. On the grid, we have "test1" selected and on the treeview we have "test1". 6- select "test2" on the grid => you will have no error. On the grid, we have "test2" selected and on the treeview we have "test2" with "fonction 30 of test2" unchecked. Workaround: in order to synchronize the current row in RadGridView is to change the RadTreeView.DataSource in the RadGridView.CurrentRowChanged event.
Please refer to the attached gif file. Workaround: set the Enabled property to false at run time.
Workaround: create a custom TreeNodeContentElement and override the Synchronize method public class MyTreeNodeContentElement : TreeNodeContentElement { protected override Type ThemeEffectiveType { get { return typeof(TreeNodeContentElement); } } public override void Synchronize() { TreeNodeElement treeNodeElement = NodeElement; if (treeNodeElement == null || treeNodeElement.Data == null || treeNodeElement.Data.TreeViewElement == null || treeNodeElement.Data.Text == null) { return; } this.Text = treeNodeElement.Data.Text; } } public class MyTreeNodeElement : TreeNodeElement { protected override TreeNodeContentElement CreateContentElement() { return new MyTreeNodeContentElement(); } protected override Type ThemeEffectiveType { get { return typeof(TreeNodeElement); } } } public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radTreeView1.AllowEdit = true; this.radTreeView1.DisplayMember = "name"; this.radTreeView1.ParentMember = "pid"; this.radTreeView1.ChildMember = "id"; this.radTreeView1.DataSource = this.GetSampleData(); this.radTreeView1.CreateNodeElement += radTreeView1_CreateNodeElement; this.radTreeView1.ValueChanged += radTreeView1_ValueChanged; } private void radTreeView1_CreateNodeElement(object sender, Telerik.WinControls.UI.CreateTreeNodeElementEventArgs e) { e.NodeElement = new MyTreeNodeElement(); } private void radTreeView1_ValueChanged(object sender, Telerik.WinControls.UI.TreeNodeValueChangedEventArgs e) { this.UpdateDb(); } private void UpdateDb() { this.radTreeView1.DataSource = null; DataTable dt = this.GetSampleData(); this.radTreeView1.DataSource = dt; } private DataTable GetSampleData() { DataTable dt = new DataTable(); DataColumn dc = new DataColumn(); dc.ColumnName = "id"; dc.DataType = typeof(int); dt.Columns.Add(dc); DataColumn dc1 = new DataColumn(); dc1.ColumnName = "name"; dc1.DataType = typeof(string); dt.Columns.Add(dc1); DataColumn dc2 = new DataColumn(); dc2.ColumnName = "pid"; dc2.DataType = typeof(int); dt.Columns.Add(dc2); DataRow dr = dt.NewRow(); dr[0] = 0; dr[1] = "My Computer"; dr[2] = DBNull.Value; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = 1; dr[1] = @"C:\"; dr[2] = 0; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = 2; dr[1] = @"D:\"; dr[2] = 0; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = 3; dr[1] = "Program Files"; dr[2] = 1; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = 4; dr[1] = "Microsoft"; dr[2] = 3; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = 5; dr[1] = "Telerik"; dr[2] = 3; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = 6; dr[1] = "WINDOWS"; dr[2] = 1; dt.Rows.Add(dr); return dt; } }
To reproduce: select a node and click the button. Note: it may be necessary to perform this several times. public partial class Form1 : Form { public Form1() { InitializeComponent(); } private List<DataObject> GetDataList() { var ret = new List<DataObject>(); ret.Add(new DataObject() { Node = "A", Parent = null }); ret.Add(new DataObject() { Node = "B", Parent = "A" }); ret.Add(new DataObject() { Node = "C", Parent = "B" }); ret.Add(new DataObject() { Node = "D", Parent = "B" }); return ret; } private void button1_Click(object sender, EventArgs e) { radTreeView1.Nodes.Clear(); radTreeView1.DisplayMember = "Node"; radTreeView1.ChildMember = "Node"; radTreeView1.ParentMember = "Parent"; radTreeView1.DataSource = GetDataList(); radTreeView1.ExpandAll(); } } public class DataObject { public string Node { get; set; } public string Parent { get; set; } } Workaround: instead of clearing the nodes, set the DataSource property to null.
Use the attached project to reproduce. - Check on of the nodes and then press Alt +T (do not move the mouse away from the node) Workaround: Set transparent fill and border to the TreeNodeElement disabled state in Visual Style Builder.
Workaround: this.radTreeView1.TreeViewElement.InvalidateMeasure(); this.radTreeView1.TreeViewElement.InvalidateArrange();
To reproduce: private void Form1_Load(object sender, EventArgs e) { this.radTreeView1.Nodes.Add("Node1"); this.radTreeView1.Nodes.Add("Node2"); this.radTreeView1.Nodes.Add("Node3"); this.radTreeView1.Nodes.Add("Node4"); this.radTreeView1.Nodes.Add("Node5"); this.radTreeView1.Nodes.Add("Node6"); this.radTreeView1.Nodes["Node1"].Nodes.Add("Node11"); this.radTreeView1.Nodes["Node1"].Nodes.Add("Node12"); this.radTreeView1.Nodes["Node1"].Nodes.Add("Node13"); this.radTreeView1.Nodes["Node1"].Nodes.Add("Node14"); this.radTreeView1.Nodes["Node2"].Nodes.Add("Node21"); this.radTreeView1.Nodes["Node2"].Nodes.Add("Node22"); this.radTreeView1.Nodes["Node2"].Nodes.Add("Node23"); this.radTreeView1.Nodes["Node2"].Nodes.Add("Node24"); this.radTreeView1.Nodes["Node3"].Nodes.Add("Node31"); this.radTreeView1.Nodes["Node3"].Nodes.Add("Node32"); this.radTreeView1.Nodes["Node3"].Nodes.Add("Node33"); this.radTreeView1.Nodes["Node3"].Nodes.Add("Node34"); this.radTreeView1.Nodes["Node4"].Nodes.Add("Node41"); this.radTreeView1.Nodes["Node4"].Nodes.Add("Node42"); this.radTreeView1.Nodes["Node4"].Nodes.Add("Node43"); this.radTreeView1.Nodes["Node4"].Nodes.Add("Node44"); this.radTreeView1.Nodes["Node5"].Nodes.Add("Node51"); this.radTreeView1.Nodes["Node5"].Nodes.Add("Node52"); this.radTreeView1.Nodes["Node5"].Nodes.Add("Node53"); this.radTreeView1.Nodes["Node5"].Nodes.Add("Node54"); this.radTreeView1.Nodes["Node6"].Nodes.Add("Node61"); this.radTreeView1.Nodes["Node6"].Nodes.Add("Node62"); this.radTreeView1.Nodes["Node6"].Nodes.Add("Node63"); this.radTreeView1.Nodes["Node6"].Nodes.Add("Node64"); } Workaround: add the nodes in the form's constructor. Second workaround: Me.RadTreeView1.TreeViewElement.Update(Telerik.WinControls.UI.RadTreeViewElement.UpdateActions.Reset)
To reproduce: Add a RadTreeView ,add nodes, enable TriState, disable AutoCheckChildNodes and use this code: void cxTreeView2_NodeCheckedChanging(object sender, RadTreeViewCancelEventArgs e) { if (!cxTreeView2.AutoCheckChildNodes && cxTreeView2.CheckBoxes && cxTreeView2.TriStateMode) { cxTreeView2.TreeViewElement.NodeCheckedChanging -= cxTreeView2_NodeCheckedChanging; if (e.Node.CheckState == ToggleState.Indeterminate) { e.Cancel = true; e.Node.CheckState = ToggleState.On; CheckAllChildren(e.Node); } cxTreeView2.TreeViewElement.NodeCheckedChanging += cxTreeView2_NodeCheckedChanging; } } void CheckAllChildren(RadTreeNode parent) { foreach (var node in parent.Nodes) { node.CheckState = ToggleState.On; CheckAllChildren(node); } } Click a top node two times and remove the mouse from the checkbox, it is now showing as Indetermined but the data item is on. Workaround: void cxTreeView2_NodeCheckedChanging(object sender, RadTreeViewCancelEventArgs e) { if (!cxTreeView2.AutoCheckChildNodes && cxTreeView2.CheckBoxes && cxTreeView2.TriStateMode) { cxTreeView2.TreeViewElement.NodeCheckedChanging -= cxTreeView2_NodeCheckedChanging; if (e.Node.CheckState == ToggleState.Indeterminate) { e.Cancel = true; e.Node.CheckState = ToggleState.On; CheckAllChildren(e.Node); cxTreeView2.TreeViewElement.Update(RadTreeViewElement.UpdateActions.Reset); } cxTreeView2.TreeViewElement.NodeCheckedChanging += cxTreeView2_NodeCheckedChanging; } } void CheckAllChildren(RadTreeNode parent) { foreach (var node in parent.Nodes) { node.CheckState = ToggleState.On; CheckAllChildren(node); } }