Hi! :)

As said in the title i try to get (as a string) the parent of a selected item, but i can't manage to do it.

Of course i can easily retrieve the string of the selected item with GetItemText... But how do we retrieve its parent?

Example: if the selected item is a child of parent1, how can i know that its parent is parent1?

Thanks for your help!!

Recommended Answers

item.GetParent() will do ok?

Jump to Post

All 2 Replies

item.GetParent() will do ok?

Hi richieking,

thanks for your answer!

I finally find how to do it:

item =  self.tree.GetSelection()
parent = self.tree.GetItemParent(item)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.