Hi,
I've bound a datatable to a gridview and am trying to change the column width. The data is displayed correctly in the gridview, but I'm having trouble changing the width of a column.
After I've bound the datatable, I have the following code:
GridView1.DataSource = dt
GridView1.DataBind()
GridView1.Columns(1).ItemStyle.Width = 100
I receive the following error:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
I've bound a datatable to a gridview and am trying to change the column width. The data is displayed correctly in the gridview, but I'm having trouble changing the width of a column.
After I've bound the datatable, I have the following code:
GridView1.DataSource = dt
GridView1.DataBind()
GridView1.Columns(1).ItemStyle.Width = 100
I receive the following error:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index