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

前端 未结 5 1675
别那么骄傲
别那么骄傲 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:36

    You dont have to manually create the columns to set them the width, you can do this

     foreach (DataControlField column in OrdersGV.Columns)
        {
          column.ItemStyle.Width = Unit.Pixel(100);
        }
    

提交回复
热议问题