Recover values and pass to a GridViewRow
<p>I have a GridViewRow[] that has some data,this data is for example 4 rows that was selected from previous page (picture 1)</p>

<p><a href="https://i.stack.imgur.com/mCGk4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mCGk4.png" alt="enter image description here"></a></p>

<p>After the checkbox marked,the user has to send to a confirmation page,in this page i need to generate another gridviewRow that only has the 4 selected.i'm using a session to pass the values to another page,but i cant make it work,i doing wrong in the foreach.This is the code.</p>

<p>ASCX</p>

<pre><code>&lt;asp:GridView runat="server" class="Tabelas" Width="698px" ID="grdSimulacao"  AutoGenerateColumns="False"&gt;
                                    &lt;HeaderStyle CssClass="TabelasHeader branca-10NN"&gt;&lt;/HeaderStyle&gt;
                                    &lt;RowStyle CssClass="TabelasBody grid"&gt;&lt;/RowStyle&gt;
                                    &lt;AlternatingRowStyle CssClass="TabelasBodyAlt grid" BackColor="#EEEEEE"&gt;&lt;/AlternatingRowStyle&gt;
                                    &lt;Columns&gt;
                                        &lt;asp:BoundField HeaderText="NF" DataField="NUMNOTAFISCAL"&gt;
                                            &lt;ItemStyle HorizontalAlign="Center" /&gt;
                                        &lt;/asp:BoundField&gt;
                                        &lt;asp:BoundField HeaderText="Emissão" DataField="DTEMISSAO" DataFormatString="{0:dd/MM/yyyy}"&gt;
                                            &lt;ItemStyle HorizontalAlign="Center" /&gt;
                                        &lt;/asp:BoundField&gt;
                                        &lt;asp:BoundField HeaderText="Vencimento" DataField="DTVENCIMENTO" DataFormatString="{0:dd/MM/yyyy}"&gt;
                                            &lt;ItemStyle HorizontalAlign="Center" /&gt;
                                        &lt;/asp:BoundField&gt;
                                        &lt;asp:BoundField HeaderText="Dias" DataField="DIASANTEC"&gt;
                                            &lt;ItemStyle HorizontalAlign="Center" /&gt;
                                        &lt;/asp:BoundField&gt;
                                        &lt;asp:BoundField HeaderText="Valor(R$)" DataField="VALTOTAL" DataFormatString="{0:#,0.00}"&gt;
                                            &lt;ItemStyle HorizontalAlign="Center" /&gt;
                                        &lt;/asp:BoundField&gt;
                                        &lt;asp:BoundField HeaderText="Encargos(R$)" DataField="VLENCARGOS" DataFormatString="{0:#,0.00}"&gt;
                                            &lt;ItemStyle HorizontalAlign="Center" /&gt;
                                        &lt;/asp:BoundField&gt;
                                        &lt;asp:BoundField HeaderText="Vlr. Final(R$)" DataField="VLFINAL" DataFormatString="{0:#,0.00}"&gt;
                                            &lt;ItemStyle HorizontalAlign="Center" /&gt;
                                        &lt;/asp:BoundField&gt;
                                    &lt;/Columns&gt;
                                &lt;/asp:GridView&gt;
</code></pre>

<p>CS - The commented part is things i alrady tried but without sucess.</p>

<pre><code> public void Carrega_valores()
        {

            string NUMNOTAFISCAL = "";
            string PRAZOPGTO = "";
            GridViewRow[] valoresNovos = new GridViewRow[300];
            valoresNovos = (GridViewRow[])Session["vlColunas"];
            foreach (GridViewRow grdCount in valoresNovos)
            {
                DataTable dt = new DataTable();
                if (grdCount != null)
                {
                    //NUMNOTAFISCAL = grdCount.Cells[1].Text;
                    //PRAZOPGTO = grdCount.Cells[4].Text;
                }

                //GridViewRow row = (GridViewRow)grdCount.Rows[0].Clone();
            }
            //DataRow NewRow = dt.NewRow();
            //NewRow[1] = grdCount.Cells[1].Text;
            //dt.Rows.Add(NewRow);
            //grdSimulacao.DataSource = dt;
            //grdSimulacao.DataBind();
      //  }
                //grdSimulacao.Controls[0].Controls.Add(valoresNovos[0]);
                // grdSimulacao.DataSource = valoresNovos;
                // grdSimulacao.DataBind();
         //   }

        }
</code></pre>