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

multiple viewpath from a loop

2 Answers 16 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Attila
Top achievements
Rank 1
Attila asked on 15 Jul 2014, 12:38 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 15 Jul 2014, 03:40 PM
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.

 
0
Attila
Top achievements
Rank 1
answered on 16 Jul 2014, 08:30 AM
Thank you Vessy it's working perfectly!!!
Tags
FileExplorer
Asked by
Attila
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Attila
Top achievements
Rank 1
Share this question
or