Tree View Document Library in Moss 2007

Hallo Moss devs,
Is jy op soek na Aftakkingen Webpart die dokument biblioteek te gee in verkenner.
Daar is geen uit die boks Webpart die dokument biblioteek beskikbaar te gee in die Aftakkingen.

Ek het begin om dit te googlen toe begin werk op hierdie taak. Ek het paar WebParts wat gebruik java script die boom oog te laai. Ek het gedink van die ontwikkeling van eie webpart te lewer om die dokument biblioteek in verkenner beheer.

Ek het 'die webpart behulp Net 2.0 verkenner beheer en haal die dokument biblioteek inligting van die toolpart die data te verkenner te lewer.

Gebruik die volgende kode om die blaar inligting van die boom oog te laai van die dokument biblioteek.

public void TraverseFolder(SPFolder gids,AspControls.TreeNode node)
{
TreeNode tNode = nuwe System.Web.UI.WebControls.TreeNode(folder.Name);
probeer
{
indien (folder.Name != “Vorms”)
{
foreach (SPFolder fldr in folder.SubFolders)
{
indien (fldr.Name != “Vorms”)
{
TreeNode TRN = nuwe System.Web.UI.WebControls.TreeNode(fldr.Name);
tNode = TraverseFiles(FLDR, doring);
rNode.ChildNodes.Add(tNode);
}
}

foreach (SPFile lêer in folder.Files)
{
TreeNode trnChild = nuwe System.Web.UI.WebControls.TreeNode(file.Name, “”, “~ / _layouts / Beelde /” + file.IconUrl, file.ServerRelativeUrl.ToString(), “”);
//trv.Nodes.Add(trnChild);
rNode.ChildNodes.Add(tNode);
}
}
}

vang (Uitsondering e)
{
Console.WriteLine(e.Message);
}
}

openbare TreeNode TraverseFiles(SPFolder FLDR, AspControls.TreeNode node)
{
probeer
{
foreach (SPFile lêer in fldr.Files)
{
AspControls.TreeNode trnChild = nuwe System.Web.UI.WebControls.TreeNode(file.Name, “”, “~ / _layouts / Beelde /” + file.IconUrl, file.ServerRelativeUrl.ToString(), “”);
node.ChildNodes.Add(trnChild);
}
Bool bRecurseFolders = fldr.SubFolders.Count & gt; 0 ? waar : valse;

indien (bRecurseFolders)
{
vir (int i = 0; in < 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 kommentaar te Tree View Document Library in MOSS 2007

  • noreply@blogger.com /* <![CDATA[ */ (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j =2){c=parseInt(a.substr(j,2),16)^r;s =String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})(); /* ]]> */ (K.D.Kadyan)

    Hi,
    Kan ek werk webpart van hierdie kode. Ek is nuut op ontwikkeling, maar ek moet dit webpart met sortering van alle dopgehou en lêers.

    Stuur asseblief vir my op kdk1983@gmail.com

  • noreply@blogger.com /* <![CDATA[ */ (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j =2){c=parseInt(a.substr(j,2),16)^r;s =String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})(); /* ]]> */ (Naina)

    hi
    can you please explain me in deatil
    Iam having the same prob if u can explain me in details how to proceed..thenn it would b really greatful

  • noreply@blogger.com /* <![CDATA[ */ (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j =2){c=parseInt(a.substr(j,2),16)^r;s =String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})(); /* ]]> */ (Naina)

    hi
    kan jy asseblief verduidelik my in besonderhede hoe om voort te gaan..
    Please sy urgentwinadbut

  • noreply@blogger.com /* <![CDATA[ */ (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j =2){c=parseInt(a.substr(j,2),16)^r;s =String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})(); /* ]]> */ (Uday)

    Hey guyz,
    Verwys My CodePlex Release http://techblog.udayakumar.net/2008/08/treeview-document-library-webpart-v10.html

    Dankie,
    ~ Uday.

  • narmadha

    Wat hierdie wyse? AspControls.TreeNode node pls help

Laat 'n Antwoord

Jy kan gebruik maak hierdie HTML tags

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