Hi dv Moss,
Èske ou ap chache pou TREEVIEW WebPart yo montre bibliyotèk la dokiman nan gade pye bwa.
Pa gen okenn soti nan WebPart nan bwat ki disponib yo montre bibliyotèk la dokiman nan TREEVIEW.
Mwen te kòmanse googling li lè te kòmanse travay sou travay sa a. Mwen te resevwa kèk WebParts ki se lè l sèvi avèk script Java chaj gade nan pyebwa. Mwen te panse pou yo devlope pwòp WebPart rann bibliyotèk la dokiman nan pyebwa kontwòl vi.
Mwen te kreye lè l sèvi avèk la WebPart Filè 2.0 pyebwa kontwòl vi e Chairman enfòmasyon nan dokiman bibliyotèk nan toolpart a rann done yo to view pyebwa.
Sèvi ak kòd la sa yo chaj enfòmasyon nan fèy de vi pyebwa nan bibliyotèk la dokiman.
piblik TraverseFolder anile(SPFolder folder,AspControls.TreeNode ne)
{
TreeNode tNode = nouvo System.Web.UI.WebControls.TreeNode(folder.Name);
eseye
{
si (folder.Name != “Fòm”)
{
fortch (SPFolder fldr nan folder.SubFolders)
{
si (fldr.Name != “Fòm”)
{
TreeNode TRN = nouvo System.Web.UI.WebControls.TreeNode(fldr.Name);
tNode = TraverseFiles(FLDR, pikan);
rNode.ChildNodes.Add(tNode);
}
}
fortch (SPFile dosye ki nan folder.Files)
{
TreeNode trnChild = nouvo System.Web.UI.WebControls.TreeNode(file.Name, “”, “~ / _layouts / Images /” + file.IconUrl, file.ServerRelativeUrl.ToString(), “”);
//trv.Nodes.Add(trnChild);
rNode.ChildNodes.Add(tNode);
}
}
}
trape (Eksepsyon e)
{
Console.WriteLine(e.Message);
}
}
TraverseFiles TreeNode piblik(SPFolder FLDR, AspControls.TreeNode ne)
{
eseye
{
fortch (SPFile dosye ki nan fldr.Files)
{
AspControls.TreeNode trnChild = nouvo System.Web.UI.WebControls.TreeNode(file.Name, “”, “~ / _layouts / Images /” + file.IconUrl, file.ServerRelativeUrl.ToString(), “”);
node.ChildNodes.Add(trnChild);
}
bouleen bRecurseFolders = fldr.SubFolders.Count & gt; 0 ? vrè : fo;
si (bRecurseFolders)
{
pou (Int mwen = 0; nan < fldr.SubFolders.Count; i++)
{
TreeNode trnChild = new System.Web.UI.WebControls.TreeNode(fldr.SubFolders[i].Name);
node.ChildNodes.Add(TraverseFiles(fldr.SubFolders[i], trnChild));
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
return node;
}
Use the Traverse Folder function and pass the root element of the document library as parameter.
Now you got a Tree view with appropriate leaf nodes.
Render it in your webpart project 🙂
Hi,
Can i get working webpart of this code. I am new to development but i need this webpart with sorting of all folders and files.
Please send me on kdk1983@gmail.com
Gen
ou ka tanpri eksplike m 'nan deatil
Koulye a li te gen menm prob a si u ka eksplike m 'nan detay ki jan yo proceed..thenn li ta b reyèlman greatful
Gen
ou ka tanpri eksplike m 'nan detay ki jan yo kontinye..
tanpri urgentwinadbut li yo
Hey guyz,
Gade Release CodePlex mwen http://techblog.udayakumar.net/2008/08/treeview-document-library-webpart-v10.html
Thanks,
~ Uday.
wat sa a vle di? AspControls.TreeNode ne pls èd