Tree View Dokiman Bibliyotèk nan MOSS 2007

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 🙂

5 kòmantè Tree View Dokiman Bibliyotèk nan MOSS 2007

Leave a Reply

Ou kapab sèvi ak sa yo tags HTML

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>