There is actually no API method, but you can easily get them using jQuery.
To get selected checkboxes, use
$('#treeviewName :checked');
To get elements of a marked li container, use:
$('#treeviewName :checked').closest('li');
Once you have the li element, you can pass it to the dataItem TreeView method and get the base model and therefore its identifier or other properties.
source share