how to set gridview column width in asp.net
  • how can i set column width in gridview in asp.net
  • 4 Comments sorted by
  • Vote Up0Vote Down WaqasWaqas
    172.00 Karma Accepted Answer
    hi you can set column width for gridview in aspx side like this.

    <asp:GridView runat="server">
            <Columns>
                <asp:BoundField ControlStyle-Width="30%" DataField="FeildName1" />
                <asp:BoundField ControlStyle-Width="70%" DataField="FeildName2" />
            </Columns>
        </asp:GridView>

  • If i dont have any bound field only simple colums . so




    headerstyle is the column heading name
    item style are all data
    for further details and related topics http://www.codecorner.somee.com/
  • so try


    GridViewName.Rows[0].Cells[0].Width = 100;

    100 here define in pixel.
  • Waqas you are right . but in wizard mode of gridview we can directly set width height and all other formating .
    for further details and related topics http://www.codecorner.somee.com/

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Tagged

Popular Posts of the Week

Optimum Creative