The ClientView.CurrentSelectionID property returns the ID of the selected item.
Syntax
ClientView.CurrentSelectionID