Prado\Web\UI\WebControls\TDataGrid::loadState PHP Method

loadState() public method

This method is invoked right after control state is loaded.
public loadState ( )
    public function loadState()
    {
        parent::loadState();
        if (!$this->getEnableViewState(true)) {
            return;
        }
        if (!$this->getIsDataBound()) {
            $state = $this->getViewState('AutoColumns', array());
            if (!empty($state)) {
                $this->_autoColumns = new TDataGridColumnCollection($this);
                foreach ($state as $st) {
                    $column = new $this->AutoGenerateColumnName();
                    $column->loadState($st);
                    $this->_autoColumns->add($column);
                }
            } else {
                $this->_autoColumns = null;
            }
            $state = $this->getViewState('Columns', array());
            if ($this->_columns && $this->_columns->getCount() === count($state)) {
                $i = 0;
                foreach ($this->_columns as $column) {
                    $column->loadState($state[$i]);
                    $i++;
                }
            }
            $this->restoreGridFromViewState();
        }
    }