Help Me Regarding treeView control

saurabh15

New member
Joined
Sep 10, 2015
Messages
4
Programming Experience
Beginner
Hello all :)


I am creating simple jabber messenger client on c# using agsxmpp.dll.

I have put treeView1 to show friendlist. But whenever new friend request comes or If I accept friend request it shows same user ID 4 5 times.

So I want to remove duplicate entry in treeView node.


Please Help me.
 
Why would you need to remove duplicate entries from the TreeView? Why not just not put them there in the first place?

Thanks but I have some other issue...I am posting the screenshot of my problem below

In the screenshot you can see a username "saurabh25" is appearing more than 3 times.

So I want to remove duplicate entries.
 

Attachments

  • nodes.jpg
    nodes.jpg
    104.7 KB · Views: 51
Again, if you don't want that value in the tree multiple times then why did you add it more than once in the first place? Why are you allowing the duplicates to be added and then trying to remove them instead of preventing them being added in the first place?
 
Again, if you don't want that value in the tree multiple times then why did you add it more than once in the first place? Why are you allowing the duplicates to be added and then trying to remove them instead of preventing them being added in the first place?

Thank you :)
Please post some codes to resolve the problem.Because I am learner.I don't have much of knowledge as I am not professional.
 
You're not answering my question. I'm not going to provide code to solve a problem that shouldn't even exist in the first place. If you can't tell me why you are adding the duplicates in the first place then I can only assume that you shouldn't be, so there should be no need to take them out again.
 
I am not adding duplicates.It gets added on its own when new add request comes and after accepting the add request it again adds new nodes with same id.After that when presence from user is availabe again it adds new node with same id.Thats the reason.

So if you want I can send you my whole project file so that you can help me in this regard.

Thanks
 
What do you mean "it" adds the nodes on its own? TreeViews don't have minds of their own. It's your control; it's your code; it's your application. If nodes are getting added to the TreeView it's because YOU have written code to add them. Don't write more code to remove nodes that you never should have added in the first place. Change the code that you already have so that it doesn't add the duplicate nodes in the first place.
 
Back
Top Bottom