// public static List<TreeViewData> ConvertToTreeViewData(
/// <summary>
/// 向TreeView填充数据
/// </summary>
/// <param name="treeView"></param>
/// <param name="treeDatas">要填充的数据</param>
/// <param name="pID">最高类别的父类别</param>
/// <returns></returns>
public static bool InsertDataToTreeView(TreeView treeView, List<TreeViewData> treeDatas,int pID) {
TreeViewTool.pID = pID;
int len = treeDatas.Count;
int j = 0;
for (int i = 0; i < len; i++) {
if ((int)treeDatas[i].PID == pID) {
treeView.Nodes.Add(treeDatas[i].Name.ToString());
treeView.Nodes[j].Tag = treeDatas[i].Id;
j++;
}
}
c# treeView 绑定集合
最新推荐文章于 2022-12-24 18:48:03 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)