Dynamic column width

Posted by nCdy on Stack Overflow See other posts from Stack Overflow or by nCdy
Published on 2010-03-15T10:57:23Z Indexed on 2010/03/15 10:59 UTC
Read the original article Hit count: 336

Filed under:
|
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;

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about .NET