On a RowDataBound Event.
Find a DropDownList Control first.<clear>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList ddl = (DropDownList)e.Row.FindControl("ddlCategories");
if (ddl != null)
{
ddl.DataSource ==
ddl.DataBind();
}
}
}
Please
vote and
Accept Answer if it Helped.