@Nikky This example might give you some ideas. I don't think manipulating the UI control like I'm doing is the best way to go, but it works. If you have a directory selected, the Add button will put a new entry under it. If a file is selected, the Add button will put a new entry as a sibling of the selected item.