public function setViewModel(ViewModel $viewModel)
    {
        if ($this->viewModel !== null) {
            throw new \Exception(
                'A viewModel is already set. Did you already called ' .
                '$grid->render() or $grid->getViewModel() before?'
            );
        }

        $this->viewModel = $viewModel;
    }