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

前端 未结 5 1716
别那么骄傲
别那么骄傲 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 was able to change the width of a certain Gridview column (bound to a Datatable) with the RowDataBound event:

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) {
        e.Row.Cells[0].Attributes["width"] = "200px";
    }
    

提交回复
热议问题