GridView BoundField Width

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mohaaron@gmail.com

    GridView BoundField Width

    Why does it seem like is impossible to set the width of a BoundField
    in a GridView. I've tried all sorts of different way to set the width
    and none of them work. So far the only thing I've done that has worked
    is to set the Wrap property to false which is not what I want do.

    Can anyone tell me now to set the column width of a GridView in the
    aspx file code?
  • Paul Shapiro

    #2
    Re: GridView BoundField Width

    This works in a DetailsView so I think it should in a GridView:
    <asp:BoundFie ld DataField="Your FieldName" HeaderText="You r Field
    Label" SortExpression= "YourFieldN ame" >
    <ControlStyle Width="500px" />
    <ItemStyle Width="500px" />
    </asp:BoundField>

    <mohaaron@gmail .comwrote in message
    news:4b15131b-4d4a-4c9f-9de8-5a12a7721b7c@n2 0g2000hsh.googl egroups.com...
    Why does it seem like is impossible to set the width of a BoundField
    in a GridView. I've tried all sorts of different way to set the width
    and none of them work. So far the only thing I've done that has worked
    is to set the Wrap property to false which is not what I want do.
    >
    Can anyone tell me now to set the column width of a GridView in the
    aspx file code?

    Comment

    • mohaaron@gmail.com

      #3
      Re: GridView BoundField Width

      I just tried the following and it doesn't work.

      <asp:BoundFie ld DataField="Comm ents" HeaderText="Com ments"
      SortExpression= "Comments" >
      <ControlStyle Width="500px" />
      <ItemStyle Width="500px" />
      </asp:BoundField>

      On Feb 12, 11:20 am, "Paul Shapiro" <p...@hideme.br oadwayData.com>
      wrote:
      This works in a DetailsView so I think it should in a GridView:
                  <asp:BoundFie ld DataField="Your FieldName" HeaderText="You r Field
      Label" SortExpression= "YourFieldN ame" >
                      <ControlStyle Width="500px" />
                      <ItemStyle Width="500px" />
                  </asp:BoundField>
      >
      <mohaa...@gmail .comwrote in message
      >
      news:4b15131b-4d4a-4c9f-9de8-5a12a7721b7c@n2 0g2000hsh.googl egroups.com...
      >
      >
      >
      Why does it seem like is impossible to set the width of a BoundField
      in a GridView. I've tried all sorts of different way to set the width
      and none of them work. So far the only thing I've done that has worked
      is to set the Wrap property to false which is not what I want do.
      >
      Can anyone tell me now to set the column width of a GridView in the
      aspx file code?- Hide quoted text -
      >
      - Show quoted text -

      Comment

      Working...