How to Set a gridview column width when binding to a datatable

前端 未结 5 1673
别那么骄傲
别那么骄傲 2021-01-12 00:12

I am binding a table to a gridview in asp.net as such

grdIssues.DataSource = mdtIssues;

grdIssues.DataBind();

The problem is I cannot the

5条回答
  •  时光说笑
    2021-01-12 00:39

    I did it as:

    gridView1.HeaderRow.Cells[0].Attributes["Width"] = "100px";
    gridView1.HeaderRow.Cells[1].Attributes["Width"] = "50px";
    gridView1.HeaderRow.Cells[2].Attributes["Width"] = "200px";
    

提交回复
热议问题