### Get Selected Row

To get the current row of a treeview, use JavaObject.
More information:
http://docs.oracle.com/javafx/2/api/javafx/scene/control/TreeView.html
`Sub Process_Globals
Private TreeView1 As TreeView
...
End Sub`
'Default event to get the selected item
`Sub TreeView1_SelectedItemChanged(SelectedItem As TreeItem)
Log($"TreeView Item selected: ${SelectedItem.Text}"$)
End Sub`
Then depending on the visible tree items, get the row umber of the item selected.
Note:
Determing the row number is on visible(!) rows only. To get all rows, expand the treeview first (see Sub below).
`Sub TreeView1_SelectedItemChanged(SelectedItem As TreeItem)
Log($"TreeView Item selected: ${SelectedItem.Text}"$)
Private JO As JavaObject = TreeView1
Dim rowNr As Int = JO.RunMethod("getRow", Array As Object(SelectedItem))
Log($"Treeview RowNr: ${rowNr}"$)
End Sub`
'Expand all treeview items
'Example: ExpandAllItems(TreeView1.Root)
`Sub ExpandAllItems(ti As TreeItem)
For Each tii As TreeItem In ti.Children
tii.Expanded = True
ExpandAllItems(tii)
Next
End Sub`

Changed: , Category: TreeView, File: T6C272M2022.htm, ID: 2022