I was wondering if anyone has used a TreeView in Silverlight to load all of the folders and items in a MOSS 2007 Document Library. I am using the List Service.GetListItems() and I get all of the Folders/Items back, but in a flat hierarchy. Has anyone built out the hierarchy in code so it will load into a Treeview control? I am trying to write the code now, but I wanted to see if anyone tried it already.
Thanks
Mark
Loading
Master BillaPosted Nov 7, 2009, 11:03 PM
Just i read this article last time for build treeview in silver light using xml file, same way you can get the list of folder and files from the sharepoint .
Get the folder and files in Sharepoint
private void GetListOfFolderAndFiles()
{
SPSite mysite = new SPSite("http://localhost"); // replace localhost with the URL of your site
SPWeb myweb = mysite.OpenWeb();
SPFolder mylibrary = myweb.Folders["Name of library"];
SPFileCollection files = mylibrary.Files;
}
Thank you