The selectedItem property is the row number in the dataset of that leaf item. When no leaf is selected, it’s -1.