Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
protected void gvIssuedetails_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["IssueTracker"].ConnectionString);
DropDownList ddlupdatestatus = (DropDownList)e.Row.FindControl("ddlupdatestatus");
Label lblupdatestatus = (Label)e.Row.FindControl("lblupdatestatus");
if (ddlupdatestatus != null)
{
SqlCommand cmdselect = new SqlCommand();
SqlDataAdapter sda = new SqlDataAdapter(cmdselect);
cmdselect.CommandType = CommandType.StoredProcedure;
cmdselect.CommandText = "usp_getstatusclient";
cmdselect.Connection = con;
DataTable dt = new DataTable();
sda.Fill(dt);
if (dt.Rows.Count > 0)
{
ddlupdatestatus.DataSource = dt;
ddlupdatestatus.DataTextField = "StatusName";
ddlupdatestatus.DataValueField = "StatusId";
ddlupdatestatus.DataBind();
ddlupdatestatus.Items.Insert(0, new ListItem("--SELECT--", "0"));
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Source Not Available');", true);
}
ddlupdatestatus.SelectedValue = lblupdatestatus.Text;
}
}
}


when I place the breakpoint it doesnot goes to this method and it is not executed , that is why i am unable to bind the ddl in griditem.

Please suggest me some solution.
Posted

1 solution

OnRowDataBound="gvIssuedetails_RowDataBound" in aspx page
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900