Dynamic column width
- by nCdy
protected void GridView1_DataBound(object sender, EventArgs e)
{
GridView1.Columns[0].ItemStyle.Width = 400;
<asp:GridView ID="GridView1" runat="server"
DataSourceID="ObjectDataSource1"
ObjectDataSource1 returns data table , but I can't find any width property there , so I guess there is GridView side option but even on data bound there is like no columns ...
protected void GridView1_DataBound(object sender, EventArgs e)
{
if (GridView1.Columns.Count!=0)
GridView1.Columns[0].ItemStyle.Width = 800;