Access the data in Gridview in runtime when it set auto generate?
<p>i imported my data from Excel sheet to grid view.after that i want to put the column header text of my grid view into drop down,but i can't access them
help me plz :-( ;</p>

<p>this is my code but it dose not work :</p>

<pre><code>List&lt;string&gt; lst = new List&lt;string&gt;();
* for (int i = 0; i &lt; dg_excel.Columns.Count; i++)
{
    lst.Add(dg_excel.Columns[i].HeaderText);
}
ddl_prd_count.DataSource;
ddl_prd_count.DataBind();
</code></pre>

<p>for this <code>*</code> line it says to me there are no columns (column.count = 0)</p>
