how to populate FileExplorer from List?

2 posts, 0 answers
  1. Robert
    Robert avatar
    16 posts
    Member since:
    Feb 2016

    Posted 10 Mar Link to this post


    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;



  2. Vessy
    Vessy avatar
    1355 posts

    Posted 11 Mar Link to this post

    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:

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top