62,074
社区成员
发帖
与我相关
我的任务
分享
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[0].Width = 480;
e.Row.Cells[1].Width = 200;
}
}
<style type="text/css">
#GridView1 tr td:first-child { width: 100px } /* 第一列 */
#GridView1 tr td:first-child+td { width: 200px } /* 第二列 */
#GridView1 tr td:first-child+td+td { width: 300px } /* 第三列 */
</style>