Hi Moss devs,
Qed tfittex webpart Treeview biex juru l-librerija dokument fid-dawl tas-siġar.
M'hemm l-ebda mill-webpart kaxxa disponibbli biex juru l-librerija dokument Treeview.
I bdew googling meta bdew jaħdmu fuq dan il-kompitu. Sibt webparts ftit li tuża l-iskrittura java biex jgħabbi l-ħsieb siġra. Ħsibt li jiżviluppaw webpart stess biex tirrendi l-librerija dokument fil-kontroll minħabba siġra.
I ħolqu l-webpart jużaw. Net 2.0 fehma siġra kontroll u jġibu l-informazzjoni librerija dokument mill-toolpart biex irendu d-data għall-opinjoni tas-siġar.
Uża l-kodiċi li ġejjin tat-tagħbija l-informazzjoni weraq ta 'opinjoni siġra mill-librerija dokument.
TraverseFolder pubbliku null(SPFolder jingħalaq,AspControls.TreeNode node)
{
TreeNode tNode = ġdid System.Web.UI.WebControls.TreeNode(folder.Name);
jippruvaw
{
jekk (folder.Name != “Formoli”)
{
foreach (FLDR SPFolder fil folder.SubFolders)
{
jekk (fldr.Name != “Formoli”)
{
TreeNode TRN = ġdid System.Web.UI.WebControls.TreeNode(fldr.Name);
tNode = TraverseFiles(fldr, TRN);
rNode.ChildNodes.Add(tNode);
}
}
foreach (Fajl SPFile fil folder.Files)
{
TreeNode trnChild = ġdid System.Web.UI.WebControls.TreeNode(file.Name, “”, “~~~HEAD=NNS / _layouts / Stampi /” + file.IconUrl, file.ServerRelativeUrl.ToString(), “”);
//trv.Nodes.Add(trnChild);
rNode.ChildNodes.Add(tNode);
}
}
}
qabda (Eċċezzjoni e)
{
Console.WriteLine(e.Message);
}
}
pubbliku TraverseFiles TreeNode(SPFolder FLDR, AspControls.TreeNode node)
{
jippruvaw
{
foreach (Fajl SPFile fil fldr.Files)
{
AspControls.TreeNode trnChild = ġdid System.Web.UI.WebControls.TreeNode(file.Name, “”, “~~~HEAD=NNS / _layouts / Stampi /” + file.IconUrl, file.ServerRelativeUrl.ToString(), “”);
node.ChildNodes.Add(trnChild);
}
bRecurseFolders bool = fldr.SubFolders.Count> 0 ? veru : falza;
jekk (bRecurseFolders)
{
għall (i int = 0; fl < 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,
Nista 'nikseb webpart' ħidma ta 'dan il-kodiċi. I am ġodda għall-iżvilupp iżda i ħtieġa dan webpart bil-għażla ta 'l-folders u fajls.
Jekk jogħġbok ibgħat lili kdk1983@gmail.com
hi
tista 'jekk jogħġbok spjega lili fl deatil
Iam wara li l-problemi istess jekk u jistgħu jispjegaw me Dettalji kif jipproċedu .. thenn li kieku b verament grat
hi
tista 'jekk jogħġbok spjega lili Dettalji kif għandhom jipproċedu..
jekk jogħġbok urgentwinadbut tagħha
Hey guyz,
Irreferi Rilaxx CodePlex Tiegħi http://techblog.udayakumar.net/2008/08/treeview-document-library-webpart-v10.html
Grazzi,
~ Uday.
wat dan ifisser? AspControls.TreeNode PLS node jgħinu