This is a migrated thread and some comments may be shown as answers.

how to populate FileExplorer from List?

1 Answer 128 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 11 Mar 2016, 02:42 AM

Hi,

I am retrieving file names and meta data from Web Service and have them in a C# List.

How can I set this list as source to populate them in FileExplorer?

Tried something like that with no success.

 List<Telerik.Web.UI.Widgets.FileItem> files = new List<Telerik.Web.UI.Widgets.FileItem>();
 files.Add(new Telerik.Web.UI.Widgets.FileItem(filetmp.Name, filetmp.Extension, filetmp.Length, filetmp.FullName, filetmp.FullName, filetmp.FullName, Telerik.Web.UI.Widgets.PathPermissions.Delete | Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload));

FileExplorer1.Grid.Source = files;

 

thanks

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 11 Mar 2016, 02:38 PM
Hi Rober,

I am afraid that the desired scenario cannot be achieved out-of-the-box with RadFileExplorer. The control cannot be bound explicitly to a specific set of file items (nor its child Grid control) as there is a content provider class which is managing the content loaded into FileExplorer (the path to which is set to the ViewPaths property). By detauld this provider can work only with the content of folders placed inside the aplication's root directory.

In order to bind RadFileExplorer to different file souce you will need to implement a custom FileBrowserContentProvider.  You can find various custom content providers implemented by us in the KnowledgeBase and CodeLibrary sections of our site and use them as a base for your implementation.

A live demo with RadFileExplorer with a DataBase content provider can be seen here:
http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/server-sideapi/dbfilebrowsercontentprovider/defaultcs.aspx

Regards,
Vessy
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
FileExplorer
Asked by
Robert
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or