setting datasource for dropdown list inside of gridview
<p>I am using the following code to set a datasource for a dropdown inside of my gridview but it is not working.</p>

<pre><code>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        DropDownList drop = (DropDownList)e.Row.FindControl("folderslist");
        drop.DataSource = list;
        drop.DataBind(); 

    }
</code></pre>

<p>list is a list of strings, which binds find to a dropdown I have outside of my gridview.  However the code above does not populate the dropsdown inside the gridview.</p>

<pre><code>&lt;asp:GridView ID="GridView1" HorizontalAlign="Center" 
                                AutoGenerateColumns="false" CellSpacing="5" CellPadding="5" CssClass="GridView" Font-Size="Small"
                                runat="server" OnRowDataBound = "GridView1_RowDataBound" &gt;

                         &lt;Columns&gt;


                         &lt;asp:BoundField HeaderText="From" DataField="From" /&gt;

                         &lt;asp:BoundField HeaderText="Subject" DataField="Subject" /&gt;

                         &lt;asp:BoundField HeaderText="Received" DataField="Received" /&gt;





                         &lt;asp:TemplateField HeaderText="Attachments" ItemStyle-HorizontalAlign="Center"&gt;
                                    &lt;ItemTemplate&gt;
                                        &lt;asp:ImageButton runat="server" ID="attach" CommandName="viewattachments" Text="More"
                                            ImageUrl="~/images/notes.png" visible='&lt;%# System.Convert.ToBoolean((DataBinder.Eval(Container.DataItem, "Attachments").ToString() == "") ? false : true) %&gt;' /&gt;


                                    &lt;/ItemTemplate&gt;
                                    &lt;ItemStyle HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                &lt;/asp:TemplateField&gt;


                                &lt;asp:TemplateField HeaderText="Move To" ItemStyle-HorizontalAlign="Center"&gt;
                                    &lt;ItemTemplate&gt;

                                      &lt;asp:DropDownList ID="folderslist" runat="server"&gt;&lt;/asp:DropDownList&gt;

                                    &lt;/ItemTemplate&gt;
                                    &lt;ItemStyle HorizontalAlign="Center"&gt;&lt;/ItemStyle&gt;
                                &lt;/asp:TemplateField&gt;

&lt;/Columns&gt;
                            &lt;/asp:GridView&gt;
</code></pre>
