Error when binding gridview data to a datatable
<p>I've a gridview in which i bind some data to it.After binding it i want to get the gridview content in a new data table.</p>

<p>Here's my c# code</p>

<pre><code>    Datatable dt_NewTable = new DataTable();        
    foreach (GridViewRow gvRow in gdMainDetails.Rows)
    {            
        DataRow dr = dt_NewTable.NewRow();
        for (int i = 0; i &lt; gvRow.Cells.Count; i++)
        {
            dr[i] = gvRow.Cells[i].Text;
        }
        dt_NewTable.Rows.Add(dr);
    }
</code></pre>

<p>The problem is that i'm getting 'gvRow.Cells[i].Text' as "".
What's the problem ?? </p>
