您的位置:首页 > 其它

Gv在编辑的时候如何控制TextBox的大小

2008-09-18 13:43 363 查看
protected void gv_PreRender(object sender, EventArgs e)
{
if (gv.EditIndex > -1)
{
int intLength = 0;
for (int i = 1; i < gv.Rows[gv.EditIndex].Cells.Count-1; i++)
{
TextBox TXTb = new TextBox();
TXTb = (TextBox)gv.Rows[gv.EditIndex].Cells[i].Controls[0];
intLength = TXTb.Text.Length;
intLength = intLength * 7;
if (intLength < 50)
intLength = 50;
TXTb.Width = intLength;
}
}

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐