N
N
Nikolai2021-04-24 03:24:36
C++ / C#
Nikolai, 2021-04-24 03:24:36

How to remove duplicate row from treeview ( treenode )?

how to remove duplicate row using loop

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nicholas, 2021-04-24
@moClay

string x = " ";

for (int k = 0; k < node.Nodes[index].Nodes.Count; k++)
            {

                if ( x.Contains(node.Nodes[index].Nodes[k].Text)/*node.Nodes[index].Nodes[k].Text != x*/)
                {
                    node.Nodes[index].Nodes.Remove(node.Nodes[index].Nodes[k]);
                    k--;
                }
                else 
                {
                    
                    x += node.Nodes[index].Nodes[k].Text;

                }
            }

P
P40b0s, 2021-04-26
@P40b0s

lst.GroupBy(x => x)
.Select(s =>s)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question