User2103319870 posted
You have a tempalte column instead of BoundColumn, so you need to assign the value from controls inside template column. First find the label control and then set the selected value in dropdownlist
protected void gvwBfbStructure_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList ddlIS = (e.Row.FindControl("ddlISg") as DropDownList);
Label lbl = (e.Row.FindControl("lblIS") as Label);
if (ddlIS != null)
{
ddlIS.DataSource = new List<string>() { "Yes", "No" };
ddlIS.DataBind();
//Set the selected value from dropdownlist
((DropDownList)e.Row.FindControl("ddlIS")).SelectedValue = lbl.Text;
}
}
}