Use this in .aspx.cs page......
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList ddl =(DropDownList) e.Row.FindControl("DropDownList1");
ddl.DataSource = "WhateverUrDataSource";
ddl.DataTextField = "YourDataTextField";
ddl.DataTextField = "YourDataValueField";
ddl.DataBind();
}
}
Use this iin .aspx page
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="194px" OnRowDataBound="GridView1_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
"Mark as Answer" on the post that helped you.
Chandan,
Imfinity India Pte Ltd.