I have a gridview with the following code:
<asp:TemplateField HeaderText="Column1">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Column1") %>'></asp:Label
</EditItemTemplate>
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" Width="125px">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
I want to bind a sql statement to populate the dropdownlist...
select Column1 from Table1 would I do this through the code behind?
You can do it in the codebehind if you wish, or, if it applies to your situation, you can use the ObjectDataSource web server control.
More reading: ObjectDataSource Web Server Control Overview
Here's an example on how to bind the ObjectDataSource to your dropdown: asp.net ObjectDataSource example: how to populate DropDownList