Fix finding the data item for TreeView templates