首页 > 解决方案 > 如果存在重复节点,如何查找节点

问题描述

在 Devexpress 树列表中。我有重复的数据,但它不能很好地工作......

例如

  1. 列表
    • 我是一名学生
    • 我是一名护士
    • 我们是朋友
    • 我们是世界
    • 这些不是我的钱

我想要的节点

  |  A  |  B  |  C  |  D  |  E  |
  ├───im
  │   └───a
  │       └───stuent
  │       └───nurse
  ├───we
  │   └───are
  │       └───friends
  │       └───the
  │           └───world
  │               └───0409

  ├───these
  │   └───are
  │       └───not
  │           └───my
  │               └───money

但我的节点是这样的

我的节点

  |  A  |  B  |  C  |  D  |  E  |
  ├───im
  │   └───a
  │       └───stuent
  │       └───nurse
  ├───we
  │   └───are
  │       └───friends
  │       └───the
  │           └───world
  │               └───0409
  │       └───not
  │           └───my
  │               └───money    
  ├───these

有重复的单词“are”,所以在使用 FindNodeByFieldValue("B", "are") 时,每个“are”单词都附加在“we”而不是“these”下

这是我的代码

treelist.AppendNode(new object[] { null, list[i].mean},
                                treelist.FindNodeByFieldValue("columnA", list[i].word));

标签: c#devexpresstreelist

解决方案


推荐阅读