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.YesDim exporter As TreeViewSpreadExport = New TreeViewSpreadExport(Me.RadTreeView1)AddHandler exporter.CellFormatting, AddressOf exporter_CellFormattingexporter.ExportFormat = SpreadExportFormat.Xlsxexporter.ExportVisualSettings = Falseexporter.ExportImages = Falseexporter.ExportChildNodesGrouped = Trueexporter.CollapsedNodeOption = HiddenOption.ExportAlwaysDim 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.