To reproduce:
1.Create new RadTreeView
2.Create new ImageList and populate
3.Assign ImageList to RadTreeView
4.Open Property Builder
5.Assign Image to a Node, Apply, Close
6.Re-Open, change Node to a different Image, the previous image remains
Expected: the new image is successfully updated.
Actual: the old image remains:
When the CheckBox of a RadTreeNode is checked programmatically, the Unknown Action parameter needs to be passed to the NodeCheckedChanging/ed event.
Repro-steps:
Observed behavior:
Expected behavior:
Repro-steps:
Observed behavior:
Expected behavior:
Use the following code:
public RadForm1()
{
InitializeComponent();
// This XML contains a simple tree with a root node having 3 children, the first of which is intended to be Bold
var xml = "<TreeView xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" MultiSelect=\"true\" AllowDragDrop=\"true\" LabelEdit=\"true\" AllowDrop=\"true\"> <Nodes Text=\"New Package\" Expanded=\"true\" ImageKey=\"Package\" Font=\"Microsoft Sans Serif, 8.25pt, style=Bold\"> <Tag xsi:type=\"xsd:string\"><Info><FullName>\\New Package</FullName><ObjectType>Package</ObjectType><IsRunnable>False</IsRunnable><IsContainer>true</IsContainer></Info></Tag> <Nodes Text=\"Query Engine\" ImageKey=\"QueryEngine\" Expanded=\"true\" Font=\"Microsoft Sans Serif, 8.25pt, style=Bold\"> <Tag xsi:type=\"xsd:string\"><Info><FullName>\\Query Engine</FullName><ObjectType>QueryEngine</ObjectType><IsRunnable>true</IsRunnable><IsTableEntity>true</IsTableEntity><IsCut>false</IsCut></Info></Tag> </Nodes> <Nodes Text=\"Connector\" ImageKey=\"Irion.SQLServer\"> <Tag xsi:type=\"xsd:string\"><Info><FullName>\\Connector</FullName><ObjectType>DBConnection</ObjectType><IsCut>false</IsCut></Info></Tag> </Nodes> <Nodes Text=\"Connector Link\" ImageKey=\"DatabaseDatalink\"> <Tag xsi:type=\"xsd:string\"><Info><FullName>\\Connector Link</FullName><ObjectType>DatabaseDatalink</ObjectType><IsRunnable>true</IsRunnable><IsTableEntity>true</IsTableEntity><IsCut>false</IsCut></Info></Tag> </Nodes> </Nodes></TreeView>";
this.radTreeView1.LoadXML(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(xml)));
//make sure that the following 2 nodes are bold:
this.radTreeView1.Nodes[0].Nodes[0].Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0);
this.radTreeView1.Nodes[0].Nodes[2].Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0);
var tvx = this.radTreeView1.TreeViewXml;
}
The XML returned by the tvx variable is different in 6.0 and 4.7.2. The Font for the node is serialized in 4.7.2:
But the font is missing in 6.0:
If the list separator for the culture is ";"
and you have nodes in RadTreeView that are bold, the following XML will be serialized:
var xml = "<TreeView xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" MultiSelect=\"true\" AllowDragDrop=\"true\" LabelEdit=\"true\" AllowDrop=\"true\"> <Nodes Text=\"New Package\" Expanded=\"true\" ImageKey=\"Package\" Font=\"Microsoft Sans Serif; 8,25pt; style=Bold\"> <Tag xsi:type=\"xsd:string\"><Info><FullName>\\New Package</FullName><ObjectType>Package</ObjectType><IsRunnable>False</IsRunnable><IsContainer>true</IsContainer></Info></Tag> <Nodes Text=\"Query Engine\" ImageKey=\"QueryEngine\" Expanded=\"true\" Font=\"Microsoft Sans Serif; 8,25pt; style=Bold\"> <Tag xsi:type=\"xsd:string\"><Info><FullName>\\Query Engine</FullName><ObjectType>QueryEngine</ObjectType><IsRunnable>true</IsRunnable><IsTableEntity>true</IsTableEntity><IsCut>false</IsCut></Info></Tag> </Nodes> <Nodes Text=\"Connector\" ImageKey=\"Irion.SQLServer\"> <Tag xsi:type=\"xsd:string\"><Info><FullName>\\Connector</FullName><ObjectType>DBConnection</ObjectType><IsCut>false</IsCut></Info></Tag> </Nodes> <Nodes Text=\"Connector Link\" ImageKey=\"DatabaseDatalink\"> <Tag xsi:type=\"xsd:string\"><Info><FullName>\\Connector Link</FullName><ObjectType>DatabaseDatalink</ObjectType><IsRunnable>true</IsRunnable><IsTableEntity>true</IsTableEntity><IsCut>false</IsCut></Info></Tag> </Nodes> </Nodes></TreeView>";
However, if you try to load this layout on another machine where the list separator is "," the nodes wouldn't be bold:
Expected:
Actual:
Note: the problematic part is how the font is stored actually: "Microsoft Sans Serif; 8.25pt; style=Bold"Please refer to the following code snippet:
Dim root As New RadTreeNode()
root.Expanded = True
root.Text = "Root"
root.Name = "Root"
Me.RadTreeView1.Nodes.Add(root)
Dim telerikTreeNode = New RadTreeNode With
{
.Expanded = True,
.Name = "Child1",
.Text = "Child1",
.Tag = "test",
.Font = New Font("Arial", 12.0F, FontStyle.Regular)
}
Me.RadTreeView1.Nodes("Root").Nodes.Add(telerikTreeNode)
For index = 2 To 5
Dim child As New RadTreeNode()
child.Text = "Child" & index
Me.RadTreeView1.Nodes("Root").Nodes.Add(child)
Next
Please use the attached sample project.
Result in 2021.1.326:
Result in 2021.2.511
1. Start WinAppDriver.exe
2. Open the attached sample solution
3. Click "Run all" tests
You will see that the test will not be able to locate any RadTreeNode elements located outside of the first parent node collection. Note that the test uses "FindElementByName("name")" method.
I am using RadTreeView and setting FullRowSelect = false. This works for Windows7 them but doesn't work for Fluent theme.
Please refer to the attached sample project and try to edit a node. In random situations the Node argument in the Edited event is null or points to a wrong data node:
Steps to reproduce:
1. Set SortOrder to Ascending
2. Rename a root node
Hi,
on the Winform Demo application, go to the TreeView demos, and selection "Selection".
1) select the "Folders" item listed under the "Inbox" item.
2) Collapse the "Inbox" item by clicking the ARROW next to the "Inbox"
3) Hold down the SHIFT key and left-mouse click on the "Outbox" item, you end up with a selection all the way up the tree to the ROOT element
How to reproduce:
DataTable table = new DataTable();
table.Columns.Add("ParentId", typeof(int));
table.Columns.Add("ChildId", typeof(int));
table.Columns.Add("ProductId", typeof(int));
table.Columns.Add("ProductCode", typeof(string));
table.Rows.Add(0, 1, 3, "Pr - 01");
table.Rows.Add(1, 2, 4, "P r- 02");
table.Rows.Add(1, 3, 5, "Pr - 03");
this.radTreeView1.DisplayMember = "ProductCode";
this.radTreeView1.ParentMember = "ParentId";
this.radTreeView1.ChildMember = "ChildId";
this.radTreeView1.ValueMember = "ProductId";
this.radTreeView1.DataSource = table;
Please run the attached sample project and follow the steps illustrated in the gif file. You will notice the following behavior:
If you select multiple items/nodes and then right click on the last selected item/node, the context menu comes up as expected and multiple selection is kept. But if you right click on any other item/node that is selected,the selected nodes become unselected and only the node you are over becomes selected.
The multiple selection is kept in Windows Explorer and VS Solution explorer wne you right click over an already selected node.
Workaround:
public RadForm1()
{
InitializeComponent();
this.radTreeView1.MultiSelect = true;
this.radTreeView1.AllowDefaultContextMenu = true;
}
class CustomTreeViewElement : RadTreeViewElement
{
protected override Type ThemeEffectiveType
{
get
{
return typeof(RadTreeViewElement);
}
}
protected override bool ProcessMouseDown(MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
RadContextMenu menu = this.ContextMenu;
RadTreeNode node = this.GetNodeAt(e.Location);
if (node!=null)
{
node.Selected = true;
}
if (node != null && node.ContextMenu != null)
{
menu = node.ContextMenu;
}
if (menu == null && this.AllowDefaultContextMenu)
{
menu = this.InitializeDefaultContextMenu(node);
}
if (menu != null)
{
RadControl parentControl = (this.ElementTree.Control as RadControl);
if (parentControl != null)
{
menu.ThemeName = parentControl.ThemeName;
menu.DropDown.RightToLeft = parentControl.RightToLeft;
}
TreeViewContextMenuOpeningEventArgs args = new TreeViewContextMenuOpeningEventArgs(node, menu, this);
OnContextMenuOpening(args);
if (!args.Cancel)
{
menu.Show(this.ElementTree.Control, e.Location);
return true;
};
}
}
return base.ProcessMouseDown(e);
}
}
class CustomTreeView : RadTreeView
{
protected override RadTreeViewElement CreateTreeViewElement()
{
return new CustomTreeViewElement();
}
public override string ThemeClassName
{
get
{
return typeof(RadTreeView).FullName;
}
}
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case 0x7b:
return;
}
base.WndProc(ref m);
}
}
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.