How do I span the header text in a GridView (c#)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dixonjm
    New Member
    • Jun 2007
    • 32

    How do I span the header text in a GridView (c#)

    Hi,

    I cant seem to find a way to do the above. I have 4 columns in a grid view. My HeaderTemplate consists of an asp:checkbox, I would like to add text to this checkbox rather than just a tooltip, but if I add text it makes my first column in the grid far too wide!

    Im sure there is a way to do this!

    Please help.

    Thanks
    Janet
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    One way may be to fudge it with a table immediately above gridview. Otherwise I'm sure there some tricker way to add a first row and get it the dimensions that you want. HTH.

    Comment

    • dixonjm
      New Member
      • Jun 2007
      • 32

      #3
      Thanks.

      Im curious, again, what is HTH?

      Found it - Hope this Helps!!!

      Comment

      • nateraaaa
        Recognized Expert Contributor
        • May 2007
        • 664

        #4
        Originally posted by dixonjm
        Hi,

        I cant seem to find a way to do the above. I have 4 columns in a grid view. My HeaderTemplate consists of an asp:checkbox, I would like to add text to this checkbox rather than just a tooltip, but if I add text it makes my first column in the grid far too wide!

        Im sure there is a way to do this!

        Please help.

        Thanks
        Janet
        You should be able to set the Width property of the HeaderTemplate to a specific width. You could also set the size property of the CheckBox text to a smaller size.

        Give these a try and let us know if it works.

        Nathan

        Comment

        Working...