The following code controls the

The following code controls the width of a datagrid edit mode textbox:

protected void DataGrid_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.EditItem)
{
TextBox txtBox =(TextBox)e.Item.Cells[1].Controls[0];
txtBox.Width = 50;

}
}

Leave a comment