Vasanth Jack

Vasanth Jack

  • NA
  • 289
  • 33.1k

How to change the Button color which in the nested Gridview

Jan 17 2017 5:38 AM
I have a button which is inside the datalist,te datalist which is inside the Gridview.
 
I want to change the button color which is inside the datalist 
 
protected void rptrbus_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string id = rptrbus.DataKeys[e.Row.RowIndex].Value.ToString();
// Session["id"] = id.ToString();
DataList dlseat = e.Row.FindControl("dlSeat") as DataList;
string strConnString = ConfigurationManager.ConnectionStrings["str"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
SqlCommand cmd = new SqlCommand("sp_Trial1", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
// string id = HttpContext.Current.Session["id"].ToString();
cmd.Parameters.AddWithValue("@id", id);
DataTable dt = new DataTable();
da.Fill(dt);
dlseat.DataSource = dt;
dlseat.DataBind();
}
 

Answers (1)