Column won't resize in datagrid

Discussion in 'ASP .Net' started by VB Programmer, Sep 25, 2004.

  1. I cannot get my first 2 columns to adhear to my width settings. Any ideas?

    The datagrid is defined as:

    <asp:DataGrid id="dgLog" runat="server" Width="990px" Height="96px"
    BorderColor="#999999" BorderStyle="None"
    BorderWidth="1px" BackColor="White" CellPadding="3"
    Font-Names="Verdana" AutoGenerateColumns="False"
    GridLines="Vertical" Font-Size="X-Small">
    <SelectedItemStyle Font-Bold="True" ForeColor="White"
    BackColor="#008A8C"></SelectedItemStyle>
    <AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
    <ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
    <HeaderStyle Font-Names="Verdana" Font-Bold="True"
    HorizontalAlign="Center" ForeColor="White"
    BackColor="#000084"></HeaderStyle>
    <FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
    <Columns>
    <asp:BoundColumn DataField="EmailSent" HeaderText="Date Time">
    <HeaderStyle Width="150px"></HeaderStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="Subject" HeaderText="Subject">
    <HeaderStyle Width="250px"></HeaderStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="Recipients" HeaderText="Recipients">
    <HeaderStyle Width="250px"></HeaderStyle>
    </asp:BoundColumn>
    </Columns>
    <PagerStyle HorizontalAlign="Center" ForeColor="Black"
    BackColor="#999999" Mode="NumericPages"></PagerStyle>
    </asp:DataGrid>
     
    VB Programmer, Sep 25, 2004
    #1
    1. Advertising

  2. VB Programmer

    Juno Guest

    Hi,

    I saw you set the width of datagrid to 990px, however you aslo defined each
    columns' width(150px,250px,250px).
    And 150+250+250 not equals to 990. So what are you want datagrid to be? :)

    --
    Juno
    MCSD.NET, MCDBA, MCSE
    ----------------------------------------------------------
    Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
    DataForm.NET - The most powerful data entry web server control for ASP.NET



    "VB Programmer" <Dont*NoSpam-Please*@jEmail.com> wrote in message
    news:...
    > I cannot get my first 2 columns to adhear to my width settings. Any

    ideas?
    >
    > The datagrid is defined as:
    >
    > <asp:DataGrid id="dgLog" runat="server" Width="990px" Height="96px"
    > BorderColor="#999999" BorderStyle="None"
    > BorderWidth="1px" BackColor="White" CellPadding="3"
    > Font-Names="Verdana" AutoGenerateColumns="False"
    > GridLines="Vertical" Font-Size="X-Small">
    > <SelectedItemStyle Font-Bold="True" ForeColor="White"
    > BackColor="#008A8C"></SelectedItemStyle>
    > <AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
    > <ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
    > <HeaderStyle Font-Names="Verdana" Font-Bold="True"
    > HorizontalAlign="Center" ForeColor="White"
    > BackColor="#000084"></HeaderStyle>
    > <FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
    > <Columns>
    > <asp:BoundColumn DataField="EmailSent" HeaderText="Date Time">
    > <HeaderStyle Width="150px"></HeaderStyle>
    > </asp:BoundColumn>
    > <asp:BoundColumn DataField="Subject" HeaderText="Subject">
    > <HeaderStyle Width="250px"></HeaderStyle>
    > </asp:BoundColumn>
    > <asp:BoundColumn DataField="Recipients" HeaderText="Recipients">
    > <HeaderStyle Width="250px"></HeaderStyle>
    > </asp:BoundColumn>
    > </Columns>
    > <PagerStyle HorizontalAlign="Center" ForeColor="Black"
    > BackColor="#999999" Mode="NumericPages"></PagerStyle>
    > </asp:DataGrid>
    >
    >
     
    Juno, Sep 26, 2004
    #2
    1. Advertising

  3. I want it to match the indiv widths. Since the dg width is bigger does it
    obsolete the others?

    "Juno" <> wrote in message
    news:...
    > Hi,
    >
    > I saw you set the width of datagrid to 990px, however you aslo defined

    each
    > columns' width(150px,250px,250px).
    > And 150+250+250 not equals to 990. So what are you want datagrid to be?

    :)
    >
    > --
    > Juno
    > MCSD.NET, MCDBA, MCSE
    > ----------------------------------------------------------
    > Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
    > DataForm.NET - The most powerful data entry web server control for ASP.NET
    >
    >
    >
    > "VB Programmer" <Dont*NoSpam-Please*@jEmail.com> wrote in message
    > news:...
    > > I cannot get my first 2 columns to adhear to my width settings. Any

    > ideas?
    > >
    > > The datagrid is defined as:
    > >
    > > <asp:DataGrid id="dgLog" runat="server" Width="990px" Height="96px"
    > > BorderColor="#999999" BorderStyle="None"
    > > BorderWidth="1px" BackColor="White" CellPadding="3"
    > > Font-Names="Verdana" AutoGenerateColumns="False"
    > > GridLines="Vertical" Font-Size="X-Small">
    > > <SelectedItemStyle Font-Bold="True" ForeColor="White"
    > > BackColor="#008A8C"></SelectedItemStyle>
    > > <AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
    > > <ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
    > > <HeaderStyle Font-Names="Verdana" Font-Bold="True"
    > > HorizontalAlign="Center" ForeColor="White"
    > > BackColor="#000084"></HeaderStyle>
    > > <FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
    > > <Columns>
    > > <asp:BoundColumn DataField="EmailSent" HeaderText="Date Time">
    > > <HeaderStyle Width="150px"></HeaderStyle>
    > > </asp:BoundColumn>
    > > <asp:BoundColumn DataField="Subject" HeaderText="Subject">
    > > <HeaderStyle Width="250px"></HeaderStyle>
    > > </asp:BoundColumn>
    > > <asp:BoundColumn DataField="Recipients" HeaderText="Recipients">
    > > <HeaderStyle Width="250px"></HeaderStyle>
    > > </asp:BoundColumn>
    > > </Columns>
    > > <PagerStyle HorizontalAlign="Center" ForeColor="Black"
    > > BackColor="#999999" Mode="NumericPages"></PagerStyle>
    > > </asp:DataGrid>
    > >
    > >

    >
    >
     
    VB Programmer, Sep 28, 2004
    #3
  4. Hi,

    You can set width of datagrid to 100% and only set width of two columns
    of three.


    :)

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    EasyDotNet Inc, Sep 28, 2004
    #4
    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. Dragon

    DataGrid Column Resize

    Dragon, May 8, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    444
    Dragon
    May 8, 2007
  2. VB Programmer

    Column won't resize in datagrid

    VB Programmer, Sep 25, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    189
    VB Programmer
    Sep 28, 2004
  3. pramay

    Resize datagrid column depending on text enter by user

    pramay, Jul 15, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    195
    pramay
    Jul 15, 2005
  4. Dragon

    DataGrid Column Resize

    Dragon, May 8, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    773
    Dragon
    May 8, 2007
  5. Replies:
    2
    Views:
    1,282
    Adrienne
    Feb 13, 2005
Loading...

Share This Page