Prado\Web\UI\WebControls\TListControl::setSelectedIndex PHP Method

setSelectedIndex() public method

public setSelectedIndex ( $index )
    public function setSelectedIndex($index)
    {
        if (($index = TPropertyValue::ensureInteger($index)) < 0) {
            $index = -1;
        }
        if ($this->_items) {
            $this->clearSelection();
            if ($index >= 0 && $index < $this->_items->getCount()) {
                $this->_items->itemAt($index)->setSelected(true);
            }
        }
        $this->_cachedSelectedIndex = $index;
        if ($this->getAdapter() instanceof IListControlAdapter) {
            $this->getAdapter()->setSelectedIndex($index);
        }
    }