The Enabled property cannot be set in PropertyBuild if the RadTreeView is already data-binded via Property builder Workaround: Set the property at run-time.
Add a CodedUI test which records expanding a node in RadTreeView. Run the CodedUI test and you will see that the TestMethod throws the following exception:
"Microsoft.VisualStudio.TestTools.Extension.UITestControlNotFoundException: The playback failed to find the control with given search properties."
Sub New()
InitializeComponent()
Me.RadTreeView1.Nodes.Clear()
Me.RadTreeView1.CheckBoxes = True
Dim node = New RadTreeNode("1") With {.CheckType = CheckType.CheckBox, .Checked = True, .CheckState = ToggleState.Indeterminate}
RadTreeView1.Nodes.Add(node)
node.Nodes.Add(New RadTreeNode("1.1") With {.CheckType = CheckType.RadioButton, .Checked = True, .CheckState = ToggleState.Indeterminate})
node.Nodes.Add(New RadTreeNode("1.2") With {.CheckType = CheckType.RadioButton})
node.Nodes.Add(New RadTreeNode("1.3") With {.CheckType = CheckType.RadioButton})
node = New RadTreeNode("2") With {.CheckType = CheckType.CheckBox, .Checked = True, .CheckState = ToggleState.Indeterminate}
RadTreeView1.Nodes.Add(node)
RadTreeView1.Nodes.Add(New RadTreeNode("3"))
End Sub
Workaround:
Sub New()End Sub
Greetings,
While testing the exporting feature of RadTreeView, I noticed the following issue :
Using the code below , everything works just fine :
Me
.RadTreeView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes
Dim
exporter
As
TreeViewSpreadExport =
New
TreeViewSpreadExport(
Me
.RadTreeView1)
AddHandler
exporter.CellFormatting,
AddressOf
exporter_CellFormatting
exporter.ExportFormat = SpreadExportFormat.Xlsx
exporter.ExportVisualSettings =
False
exporter.ExportImages =
False
exporter.ExportChildNodesGrouped =
True
exporter.CollapsedNodeOption = HiddenOption.ExportAlways
Dim
renderer
As
SpreadExportRenderer =
New
SpreadExportRenderer()
exporter.RunExport(
"D:\test.xlsx"
, renderer)
But, the following line of the code raises an error in a specific circumasntance (I describe it more, further in the thread) :
exporter.RunExport(
"D:\test.xlsx"
, renderer)
Error Screenshot is attached : 1.jpg
Details about the error :
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=value should be greater or equal than 0 and less or equal than 7.
Parameter name: value
Source=Telerik.Windows.Documents.Spreadsheet
StackTrace:
at Telerik.WinControls.UI.RadButtonBase.buttonElement_Click(
Object
sender, EventArgs e)
at Telerik.WinControls.RadElement.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonElement.OnClick(EventArgs e)
at Telerik.WinControls.RadElement.DoClick(EventArgs e)
at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(
String
[] commandLine)
The Specific Circumstance :
In my RadTreeView's NodeMouseClick , I add some child nodes to the node which is clicked, at runtime :
Dim
_Node1
As
RadTreeNode = e.Node.Nodes.Add(
"Node 1"
)
Dim
_Node2
As
RadTreeNode = e.Node.Nodes.Add(
"Node 2"
)
Dim
_Node3
As
RadTreeNode = e.Node.Nodes.Add(
"Node 3"
)
Then I found out that setting "exporter.ExportChildNodesGrouped" to True causes the error. But if it is set to false, no error raised even in the above Circumstance.
P.S Normally setting "exporter.ExportChildNodesGrouped" to True or False doesn't cause any error, but adding some child nodes at run time surly does.
Thanks for your attention.
I've got a tree with multiple nodes like
document1
-page 1
-page 2
document1
-page 1
-page 2
-page 3
...
document10
-page 1
-page 2
Due to the size of the treeview, only 2 or 3 documents are on screen, the rest is scrolled. (manually added items, no dynamic or lazy loading)
Lets say I click page 2 of document one, hold the mouse button to select more and go down to the last document (the tree is automatically scrolled down, as expected)
But when I go back to review what I selected, only the last items on screen are selected (documents 9 and 10 for example).
When I try to do the same selection with the arrow keys and the shift key, it works fine, but not with the mouse.
Currently, when a node is checked its parent/child nodes are checked accordingly and for each node that has its checked state changed the NodeCheckedChanged is fired. However, there is not way to know whether the event is fired because of manual user action on the node (clicking the checkbox, pressing Space/Enter keys) or because the node is in parent/child relation with the 'clicked' node. So, event arguments about that should be added.
If you hide a node using the advanced builder go to an other node and they try to get back to the first node, you will notice that you will not be able to do so.
ADD SaveXML and LoadXML method of RadTreeView that allows loading and saving xml via stream
Add TreeViewXml property to RadTreeView that allows xml serialization by string type
When you change the dock state of window in RadDock, the hosted RadTreeView shows only the nodes from first level, if data relation binding is used.
To reproduce: use the following code snippet. You will notice that mnemonics are displayed. public RadForm1() { InitializeComponent(); new RadControlSpyForm().Show(); this.radTreeView1.DisplayMember = "name"; this.radTreeView1.ParentMember = "pid"; this.radTreeView1.ChildMember = "id"; this.radTreeView1.DataSource = this.GetSampleData(); this.radTreeView1.NodeFormatting += radTreeView1_NodeFormatting; this.radTreeView1.SelectedNodeChanged += radTreeView1_SelectedNodeChanged; this.radBreadCrumb1.DefaultTreeView = this.radTreeView1; } private void radTreeView1_SelectedNodeChanged(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e) { foreach (RadSplitButtonElement item in this.radBreadCrumb1.BreadCrumbElement.Items) { item.ActionButton.TextElement.UseMnemonic = false; } } private void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e) { e.NodeElement.ContentElement.UseMnemonic = false; } 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] = "Hello & Goodbye"; 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] = "M&icrosoft"; 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; } Workaround: set the DefaultTreeView before subscribing to the treeview events. this.radBreadCrumb1.DefaultTreeView = this.radTreeView1; this.radTreeView1.NodeFormatting += radTreeView1_NodeFormatting; this.radTreeView1.SelectedNodeChanged += radTreeView1_SelectedNodeChanged;
The RadTreeView throws NullReferenceException when scrolling is performed if it is loaded from xml document. Loading the following xml document causes the issue: <TreeView xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ShowLines="true"> <Nodes Expanded="true" Text="Test1" ImageIndex="0"> <Nodes Expanded="true" Text="Test2" ImageIndex="0"> <Nodes Expanded="true" Text="Test3" ImageIndex="2"> <Nodes Expanded="true" Text="Test4" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test5" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test6" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test7" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test18" ImageIndex="1"> <Nodes Text="Test9" ImageIndex="3" /> <Nodes Text="Test10" ImageIndex="3" /> </Nodes> <Nodes Expanded="true" Text="Test11" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test12" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test13" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test14" ImageIndex="1"> <Nodes Text="Test15" ImageIndex="3" /> <Nodes Text="Test16" ImageIndex="3" /> <Nodes Expanded="true" Text="Test17" ImageIndex="4"> <Nodes Expanded="true" Text="Test18" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test19" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test20" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> </Nodes> </Nodes> <Nodes Expanded="true" Text="Test20" ImageIndex="2"> <Nodes Expanded="true" Text="Test21" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test22" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test23" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test24" ImageIndex="1"> <Nodes Text="Test25" ImageIndex="3" /> <Nodes Text="Test26" ImageIndex="3" /> <Nodes Text="Test27" ImageIndex="3" /> <Nodes Text="Test28" ImageIndex="3" /> </Nodes> <Nodes Expanded="true" Text="Test29" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test30" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test31" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> </Nodes> <Nodes Expanded="true" Text="Test32" ImageIndex="0"> </Nodes> <Nodes Expanded="true" Text="Test33" ImageIndex="0"> <Nodes Expanded="true" Text="Test34" ImageIndex="0"> <Nodes Expanded="true" Text="Test35" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test36" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test37" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test38" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test39" ImageIndex="1"> <Nodes Text="Test40" ImageIndex="3" /> <Nodes Text="Test41" ImageIndex="3" /> </Nodes> <Nodes Expanded="true" Text="Test42" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test43" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test44" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test45" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test46" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> <Nodes Expanded="true" Text="Test47" ImageIndex="0"> <Nodes Expanded="true" Text="Test48" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test49" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test50" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> <Nodes Expanded="true" Text="Test51" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test52" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test53" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> <Nodes Expanded="true" Text="Test54" ImageIndex="0"> <Nodes Expanded="true" Text="Test55" ImageIndex="1" BackColor="232,255,232" NumberOfColors="1"> <Nodes Text="Test56" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test57" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test58" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test59" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> <Nodes Text="Test60" ImageIndex="3" BackColor="232,255,232" NumberOfColors="1" /> </Nodes> </Nodes> </Nodes> </Nodes> </TreeView>
If you add nodes in the following manner: Private arCategories() As String = {"Not Used", "Category1", "Category2", "Category3", "Category4", "Category5"} Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim node As RadTreeNode node = Me.RadTreeView1.Nodes.Add(arCategories(1)) node.Image = My.Resources.img1 AddItems(node) node = Me.RadTreeView1.Nodes.Add(arCategories(2)) node.Image = My.Resources.img2 AddItems(node) node = Me.RadTreeView1.Nodes.Add(arCategories(3)) node.Image = My.Resources.img3 AddItems(node) node = Me.RadTreeView1.Nodes.Add(arCategories(4)) node.Image = My.Resources.img4 AddItems(node) node = Me.RadTreeView1.Nodes.Add(arCategories(5)) node.Image = My.Resources.img5 AddItems(node) For Each nd As RadTreeNode In Me.RadTreeView1.Nodes For Each n As RadTreeNode In nd.Nodes n.Image = nd.Image Next Next End Sub Private Sub AddItems(ByVal node As RadTreeNode) For i As Integer = 1 To 4 node.Nodes.Add("Item" & i) Next End Sub the vertical scroll is not calculated correctly.
Workaround: Expand and collapse the nodes so that they are synchronized this.radTreeView1.ExpandAll(); this.radTreeView1.CollapseAll();
To reproduce. - Add 100 nodes so the scroll appears. - Try scrolling to bottom. Workaround: radTreeView1.TreeViewElement.Scroller.ScrollMode = ItemScrollerScrollModes.Discrete;
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; } } }
The RadTreeView throws exception when the BindingSource.CancelEdit is invoked.
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.
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
Nodes are not always dropped successfully on another treeview when the source nodes are selected.