我有以下代码:
protected void exampleGridView_RowDataBound(object o, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Width = new Unit("150px");
e.Row.Cells[1].Width = new Unit("5px");
e.Row.Cells[2].Width = new Unit("150px");
e.Row.Cells[3].Width = new Unit("150px");
e.Row.Cells[4].Width = new Unit("150px");
e.Row.Cells[5].Width = new Unit("150px");
e.Row.Cells[6].Width = new Unit("150px");
// and so on
}
}
是否也可以设置单元格的高度?谢谢!