GridView column expanding

Discussion in 'ASP .Net' started by tshad, Oct 2, 2009.

  1. tshad

    tshad Guest

    I have a GridView that I want to control all the columns widths except for
    1.

    Most of them seem to work that way except for this one:

    <asp:TemplateField ItemStyle-CssClass="alignRight"
    SortExpression="GiftAmount" HeaderStyle-Width="100px" HeaderText="Gift">
    <ItemTemplate>
    <asp:Label ID="lblGiftAmount" runat="server"
    SortExpression="GiftAmount" Width="100px" Text='<%#
    Eval("GiftAmount","{0:c}") %>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <asp:TextBox ID="txtGiftAmount" runat="server" Width="100px" Text='<%#
    Eval("GiftAmount","{0:###,###.00}") %>' />
    </EditItemTemplate>
    </asp:TemplateField>

    I have the Header, Item and Textbox are all set to 100px.

    The Grid is set to 100%.

    As I expand the grid, this column expands as well. I have another column
    that has no size.

    Shouldn't that be the only one that expands?

    How do I get this column not to expand?

    Thanks,

    Tom
     
    tshad, Oct 2, 2009
    #1
    1. Advertisements

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. Keithb
    Replies:
    2
    Views:
    1,348
  2. Greg Smith
    Replies:
    0
    Views:
    699
    Greg Smith
    Apr 12, 2007
  3. Replies:
    2
    Views:
    604
  4. Keith G Hicks
    Replies:
    3
    Views:
    993
    Keith G Hicks
    Feb 18, 2008
  5. JB
    Replies:
    1
    Views:
    1,402
  6. johnsonlim026
    Replies:
    0
    Views:
    1,087
    johnsonlim026
    Feb 27, 2010
  7. Finn Stampe Mikkelsen

    Column count / Access GridView Column after DataBind

    Finn Stampe Mikkelsen, Aug 19, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    3,649
    Finn Stampe Mikkelsen
    Aug 20, 2010
  8. Greg Smith
    Replies:
    0
    Views:
    287
    Greg Smith
    Apr 12, 2007
Loading...