locked
GridView. Header Style. Please, help me out. This is driving me nuts. RRS feed

  • Question

  • User1608082067 posted

    Hello,

    How can I apply a 400 px width to a column header?

    Thanks,

    Miguel
     

     

     

    Tuesday, November 13, 2007 9:24 PM

All replies

  • User445179017 posted

     

    <asp:GridView ID="GridView1" runat="server"....>
      <Columns>
        <asp:BoundField DataField.....>
          <ItemStyle HorizontalAlign="Left" Width="400px" />
          <HeaderStyle HorizontalAlign="Left" Width="400px" />
        </asp:BoundField>
      </Columns>
    </asp:GridView>

    Thanks

    -Mark post(s) as "Answer" that helped you 

    Wednesday, November 14, 2007 1:58 AM
  • User1608082067 posted

    Mark,

    I know how to apply the styles, but when using CSS Control Adapters they are not applied!

    I tried everything and nothing works.

    Any idea?

    I am starting to think that CSS Control Adapters leave to many things away.

    Thanks,

    Miguel
     

    Wednesday, November 14, 2007 8:22 AM
  • User-1385398420 posted

    Try this:

    <HeaderStyle HorizontalAlign="Left" CssClass="myClassName" />

    Then, in your CSS file:

    .myClassName { width:400px; }

    The CSS adapters generally do not inject inline styles. The expectation is to use CSS classes instead.

     

    Thursday, November 15, 2007 9:07 AM
  • User-1555751758 posted

    Sorry, wrong post.

    Sunday, August 28, 2011 12:48 PM