I have a dropdownlist within my editable gridview.The datasource of the gridview is a datatable method which accepts as a parameter the text of the lable of one of the columns in the gridview.I'm using the code below to try this task but it is not working.
protected void gvServices_DataBinding(object sender, GridViewRowEventArgs e)
{//gvServices is a gridview name
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList ddl = (DropDownList)e.Row.Cells[3].FindControl("DDLServType");
Label lbl = (Label)e.Row.Cells[2].FindControl("lblServiceName");
string servicename= lbl.Text;
ddl.DataSource = st.getServiceTypes(servicename);
ddl.DataBind();
}
}