multiple viewpath from a loop

3 posts, 1 answers
  1. Attila
    Attila avatar
    11 posts
    Member since:
    Jan 2013

    Posted 15 Jul 2014 Link to this post

    Hi,

    I would like to use multiple paths but from a sql reading loop.
    How can I do that?

    Of course this isn't working:

    while (reader.Read())
    {
    folderName= (string)reader["folderName"];
    viewPaths = new string[] { "~/Documents/" + folderName};
    }

    Thanks!
  2. Answer
    Vessy
    Admin
    Vessy avatar
    1389 posts

    Posted 15 Jul 2014 Link to this post

    Hello,

    You can achieve the desired configuration by storing the collected paths into a List<string>, and cast it to array when assigned to the RadFileExplorer's ViewPaths property. For example:
    List<string> viewPaths = new List<string>();
     
    while (reader.Read())
    {
        folderName = (string)reader["folderName"];
        viewPaths.Add(string.Format("~/Documents/{0}", folderName));
    }
    RadFileExplorer1.Configuration.ViewPaths = viewPaths.ToArray();

    Hope this helps.

    Regards,
    Vessy
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Attila
    Attila avatar
    11 posts
    Member since:
    Jan 2013

    Posted 16 Jul 2014 in reply to Vessy Link to this post

    Thank you Vessy it's working perfectly!!!
Back to Top