Below is the code just to give you an idea. I hope it will help.
protected void Page_Load(object sender, EventArgs e)
{
object[] dataSource = { "Cell 1", 1, 2 };
GridView1.DataSource = dataSource;
GridView1.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DataItem.GetType() == typeof(Int32))
{
TextBox txt = new TextBox();
txt.Text = e.Row.Cells[0].Text;
e.Row.Cells[0].Text = "";
e.Row.Cells[0].BackColor = System.Drawing.Color.Red;
e.Row.Cells[0].Controls.Add(txt);
}
}
}