EOD... i found the solution....
I should assume column name to bind
drdList.DataTextField = "Prod_name";
My code is...
ONPAGE_LOAD()
{
.....
Grid_Purchase.DataSource = dt;
Grid_Purchase.DataBind();
DataTable myDatatable1 = new DataTable();
myDatatable1 = SQLobj.SQL_Adapter("select Prod_name from ProductDetails");
DropDownList drdList;
DataRow dr;
dr = myDatatable1.NewRow();
dr["Prod_name"] = "-Select-";
myDatatable1.Rows.InsertAt(dr, 0);
foreach (GridViewRow grdRow in Grid_Purchase.Rows)
{
drdList = (DropDownList)(Grid_Purchase.Rows[grdRow.RowIndex].Cells[1].FindControl("txt_grd_ProdName"));
drdList.DataSource = myDatatable1;
drdList.DataTextField = "Prod_name";
drdList.DataBind();
}
}
My aspx ,page
<asp:TemplateField HeaderText="Products">
<ItemTemplate>
<asp:DropDownList ID="txt_grd_ProdName" runat="server" Width="95px" AutoPostBack="True" onselectedindexchanged="txt_grd_ProdName_SelectedIndexChanged"><asp:ListItem>-Select-</asp:ListItem> </asp:DropDownList>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<FooterTemplate>
<asp:DropDownList ID="Foot_Txt2" runat="server" Width="95px" AutoPostBack="True" ></asp:DropDownList>
</FooterTemplate>
</asp:TemplateField>