Populate dropdownlist in gridview with data from database in my edit and footer template
<p>I have trying to to no avail to have a dropdownlist on my child nested gridview. I have code behind on my asp.net 4 web application.
Below is code for my gridview.</p>

<pre><code>&lt;asp:TemplateField HeaderText="Status" SortExpression="Status"&gt;
                                            &lt;ItemTemplate&gt;&lt;%# Eval("Status")%&gt;&lt;/ItemTemplate&gt;
                                            &lt;EditItemTemplate&gt;
                                                &lt;asp:DropDownList ID="DropDownListStatus" runat="server"&gt;
                                                &lt;/asp:DropDownList&gt;

                                            &lt;/EditItemTemplate&gt;
                                            &lt;FooterTemplate&gt;
                                                &lt;asp:DropDownList ID="DropDownListStatus" runat="server" &gt;

                                                &lt;/asp:DropDownList&gt;
</code></pre>

<p>I am using SqlDataSource. Below is code behind  after I had deleted some of it which was causing errors.</p>

<pre><code>protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
{
    //Check if this is our Blank Row being databound, if so make the row invisible
    if (e.Row.RowType == DataControlRowType.DataRow)
    {

        if (((DataRowView)e.Row.DataItem)["CertificateNo"].ToString() == String.Empty) e.Row.Visible = false;

    }
}
</code></pre>

<p>I was trying to FindControl for my dropdownlist, use a query and bind it to my dropdownlist, but I failed to do such a simple thing. </p>
