Export data from RadTreeListView (Telerik ThirdParty)
Hi Everyone,
I need to export the results contained in a RadTreeListView object.
There is a lot of data inside and i can't afford to process cells and rows one by one (in terms of testing time)
I see that RadTreeListView object give access to the method:
Export(System.IO.Stream stream, Telerik.Windows.Controls.GridViewExportOptions options)
The only issue I get is to provide the seconde parameter define in this doc.
I have the Telerik DLL library if needed.
Is there a way to provide the GridViewExportOptions to the method?
Thanks!
Try using the dotNET object obtained directly from the tree list object. Maybe the global dotNET object uses a different .NET version than that used in the app, and that causes conflicts.
Also note that Export needs a Stream object, not a StreamWriter. A FileStream should work.var dotNET2 = RootApp.Grid.ContentControl.ContentPresenter.RadTreeListView.ClrAppDomain.dotNET;
// Use dotNET2 to create parameters for the Export method call // Initialize GridViewExportOptions var options = dotNET2.Telerik_Windows_Controls.GridViewExportOptions.zctor(); options.Encoding = dotNET2.System_Text.Encoding.Unicode; options.ShowColumnHeaders = true; options.ShowColumnFooters = true; // Initialize the FileStream var fileStream = dotNET2.System_IO.File.Create(path); RootApp.Grid.ContentControl.ContentPresenter.RadTreeListView.Export(fileStream, options); fileStream.Close();