public function renderChunk($rowsNumber)
    {
        /** @var ActiveDataProvider $dataProvider */
        $dataProvider = $this->grid->dataProvider;
        /** @var \yii\db\ActiveQuery $query */
        $query = $dataProvider->query;

        $result = '';
        if ($this->rowNumber === 0) {
            $result .= $this->renderHeader();
        }
        $rowCount = $this->dataReader->getRowCount();
        for ($i = 0; $i < $rowsNumber || $rowsNumber === -1; $i++) {
            $row = $this->dataReader->read();
            if ($row === false) {
                $this->dataReader = null;
                $result .= $this->renderFooter();
                break;
            }
            $models = $query->populate([$row]);

            $result .= $this->renderRow(reset($models), $this->rowNumber++, $rowCount);
        }
        return $result;
    }