public function getSelectedDataKey()
{
if ($this->getDataKeyField() === '') {
throw new TInvalidOperationException('datalist_datakeyfield_required');
}
$index = $this->getSelectedItemIndex();
$dataKeys = $this->getDataKeys();
if ($index >= 0 && $index < $dataKeys->getCount()) {
return $dataKeys->itemAt($index);
} else {
return null;
}
}