How do I set the column width if I don’t show the header?

Discussion in 'ASP .Net Web Controls' started by Dave, May 8, 2007.

  1. Dave

    Dave Guest

    How do I set the column width if I don’t show the header?

    Example:
    I set the column width with the following code:

    <asp:TemplateColumn>
    <HeaderStyle Width="175px"></HeaderStyle>
    <ItemStyle></ItemStyle>
    <ItemTemplate>
    …

    Width of column is 175px

    Then I turned off the header

    <asp:datagrid ShowHeader="False" …

    Width of column is 95px

    --
    Thanks in advance,
    Dave
    Dave, May 8, 2007
    #1
    1. Advertising

  2. Dave

    Manish Bafna Guest

    Hi,
    Try setting width in itemstyle :
    <ItemStyle ItemStyle-Width="175px"> </ItemStyle>
    --
    If my answer helped you,then please do press Yes below.
    Thanks and Regards.
    Manish Bafna.
    MCP and MCTS.



    "Dave" wrote:

    > How do I set the column width if I don’t show the header?
    >
    > Example:
    > I set the column width with the following code:
    >
    > <asp:TemplateColumn>
    > <HeaderStyle Width="175px"></HeaderStyle>
    > <ItemStyle></ItemStyle>
    > <ItemTemplate>
    > …
    >
    > Width of column is 175px
    >
    > Then I turned off the header
    >
    > <asp:datagrid ShowHeader="False" …
    >
    > Width of column is 95px
    >
    > --
    > Thanks in advance,
    > Dave
    Manish Bafna, May 9, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cal
    Replies:
    1
    Views:
    521
    Tim B
    Jan 8, 2007
  2. hansiman

    Image in header column (not replacing column header text)

    hansiman, Feb 5, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    291
    hansiman
    Feb 7, 2004
  3. Carl Howarth

    DG Column Width vs Table Column Width

    Carl Howarth, Oct 22, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    252
    Eliyahu Goldin
    Oct 24, 2004
  4. Kim Quigley

    Column width can't be set when hiding header?

    Kim Quigley, Jun 7, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    104
    Kim Quigley
    Jun 7, 2005
  5. Replies:
    2
    Views:
    234
    jyoti
    Aug 19, 2006
Loading...

Share This Page