How do I get the index number off treeview?

I cant seem to access these numbers so that I can edit the properties of the data which corresponds to that selection.

How do I do that?

Also how do I sort the information so that all the information which is passed to the treeview is sorted alphabetically? this includes information such as names being automatically sorted once the information is passed to the tree.

this is a problem since I want to do this for a program which will get the names of the people and then place them into a tree so that I can see what they have in their properties such as what they events which they have entered into etc.

Can someone give a hand on this?

Thanks