일련의 개체에서 재귀 적으로 채워 져야하는 ASP.NET treeview 컨트롤이 있습니다. 최소한 각 소스와 부모 노드에 대한 범주 이름과 설명을 계층 적으로 표시해야합니다. 이를 위해, 나는 내 코드 숨김 페이지에서 다음을 작성했습니다 :ASP.NET Treeview를 재귀 적으로 채우는 방법?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CATALooK.Automation;
namespace VBayUnMatched
{
public partial class VBayCats : System.Web.UI.UserControl
{
private int id;
private CATALooK.Automation.SourceInfo source;
private CATALooK.Automation.CategoryInfo parent;
private string catID;
private string catName;
private string desc;
private string rawData;
private int advCatID;
private DateTime lastUpdated;
protected void Page_Load(object sender, EventArgs e)
{
CategoryController cc = new CategoryController();
CategoryInfo ci = new CategoryInfo
(id,source,parent,catID,catName,desc,rawData,advCatID,lastUpdated);
//CATALooK.AdvCatInfoRemote[] acir = cc.getAdvancedCategories();
TreeView trvUnMatchedCats = new TreeView();
TreeNodeCollection tnColl = new TreeNodeCollection();
TreeNode nodeSource = new TreeNode { Value = ToString(source) };
TreeNode nodeParent = new TreeNode { Value = ToString(parent) };
TreeNode nodeName = new TreeNode { Value = catName };
}
private void PopulateTreeview()
{
}
private string ToString(SourceInfo source)
{
throw new NotImplementedException();
}
private string ToString(CategoryInfo parent)
{
throw new NotImplementedException();
}
}
}
어떻게 노드 이름 nodeSource 및 catName에 nodeParent에 부모, 자원을 할당하는 재귀를 사용합니까?
도움과 도움을 제공해 주셔서 감사합니다.
최고 재귀 방식으로
IHierarchyData
을 만드는 방법 here you see입니다. 감사합니다!! – SidC