先mark~下,晚上回家仔细琢磨下再
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
...{
if (e.Row.RowState == (DataControlRowState.Edit | DataControlRowState.Alternate) || e.Row.RowState == DataControlRowState.Edit)
...{
TextBox curText;
for (int i = 2; i < e.Row.Cells.Count; i++)
...{
if (e.Row.Cells[i].Controls.Count != 0)
...{
curText = e.Row.Cells[i].Controls[0] as TextBox;
if (curText != null)
...{
curText.Width = Unit.Pixel(50);
}
}
}
}
}