I tried a few ways to set the width of the TextBox to the width of cell[1] of the GridView but I have not figured it out yet. Does anyone know how to get the width of the TextBox to match that of the width of cell[1] of the GridView?
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace mrbeaches.Protected { public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //TextBox1.Width = GridView1.SelectedRow.Cells[1].Width; TextBox1.Width = GridView1.Width; //ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + GridView1.SelectedRow.Cells[1].Width + "');", true); } } }