My problem is the following, when you load the page for the first time you see the textbox inside the cell with the red background, but when there is a postback the textbox inside the cell is lost.
load method fill my gridview.
the idea is when the column color is red, i need to create a textbox and put the background of the textbox red;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
Load();
}
}
protected void GvCriticidad_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[2].Text == "RED") {
System.Web.UI.WebControls.TextBox txt = new System.Web.UI.WebControls.TextBox();
txt.Enabled = false;
txt.Width = 35;
txt.Height = 30;
txt.BackColor = ColorTranslator.FromHtml("#FD0707");
e.Row.Cells[2].Text = "";
e.Row.Cells[2].Controls.Add(txt);
}
}
}