TreeListNode的问题

时间:2010-11-05 10:24:41

标签: devexpress

我正在尝试创建一个treelistnode。以下代码收到错误:

        private TreeListNode CreateTreeNode(EntityInfo entity)
        {
             CategoryInfo info = entity as CategoryInfo;

             TreeListNode treeNode = new TreeListNode();
             treeNode.SetValue("CatName", info.CatName);
             treeNode.SetValue("CateCode", info.CateCode);
             treeNode.SetValue("Id", info.Id);
             treeNode.Tag = info.Id;

             return treeNode;
         }

错误

DevExpress.XtraTreeList.Nodes.TreeListNode.TreeListNode(int, DevExpress.XtraTreeList.Nodes.TreeListNodes)' is inaccessible due to its protection level

我需要你的帮助来创建一个单独的treelistnode 谢谢!

1 个答案:

答案 0 :(得分:0)

您应该使用TreeList的AppendNode方法。另请参阅How to: Create Nodes in Unbound Mode in Code主题。