consistent column widths

Discussion in 'ASP .Net Datagrid Control' started by TPSreport, Sep 4, 2003.

  1. TPSreport

    TPSreport Guest

    ASP.NET 2003. Two DataGrids, six columns each, one grid
    atop the other. I need to have the columns line up,
    i.e., DataGrid1 Col(1) lined up w/ DataGrid2 Col(1) -
    each the same width on the screen. All columns have the
    same width assigned via Property Builder, and both
    DataGrids themselves have the same total fixed width.
    Wrap is OFF for each column item because I can only
    afford the real estate for a single line; the users
    should have to highlight and drag-right to see any hidden
    text in a given cell.

    However, the text in (say) col(2) is variable in size and
    when the grids populate, col(2)'s width still expands or
    contracts. So DataGrid1 Col(2) is a different width than
    DataGrid2 Col(2) and it throws the alignment out of
    whack - even though I've hardcoded the column and
    DataGrid widths. Ideas? TIA.

    TPS
    TPSreport, Sep 4, 2003
    #1
    1. Advertising

  2. Hi,

    You can do what you describe by placing text boxes inside each cell (with
    readonly=true). Then you can size the text box to the width you prefer and
    any overflow text will be cut off. Also, each line will be a single row
    with no wrapping. Finally, a user can view overflow text by clicking inside
    the text box and selecting the text.

    Does this answer your question?

    Thank you, Mike Moore
    Microsoft, ASP.NET

    This posting is provided "AS IS", with no warranties, and confers no rights.

    --------------------
    >Content-Class: urn:content-classes:message
    >From: "TPSreport" <>
    >Sender: "TPSreport" <>
    >Subject: consistent column widths
    >Date: Thu, 4 Sep 2003 08:39:43 -0700
    >Lines: 19
    >Message-ID: <1e8401c372fa$c3063420$>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="iso-8859-1"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    >Thread-Index: AcNy+sMG6+dXIBZvSCWJUW2x9zSZQA==
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridcontrol
    >Path: cpmsftngxa06.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.datagridcontrol:6501
    >NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridcontrol
    >
    >ASP.NET 2003. Two DataGrids, six columns each, one grid
    >atop the other. I need to have the columns line up,
    >i.e., DataGrid1 Col(1) lined up w/ DataGrid2 Col(1) -
    >each the same width on the screen. All columns have the
    >same width assigned via Property Builder, and both
    >DataGrids themselves have the same total fixed width.
    >Wrap is OFF for each column item because I can only
    >afford the real estate for a single line; the users
    >should have to highlight and drag-right to see any hidden
    >text in a given cell.
    >
    >However, the text in (say) col(2) is variable in size and
    >when the grids populate, col(2)'s width still expands or
    >contracts. So DataGrid1 Col(2) is a different width than
    >DataGrid2 Col(2) and it throws the alignment out of
    >whack - even though I've hardcoded the column and
    >DataGrid widths. Ideas? TIA.
    >
    >TPS
    >
    Mike Moore [MSFT], Sep 5, 2003
    #2
    1. Advertising

  3. TPSreport

    TPSreport Guest

    Mike,
    Sorry; been away. That does answer it and I'll give it a
    go. Thanks very much.
    TPS
    >-----Original Message-----
    >Hi,
    >
    >You can do what you describe by placing text boxes

    inside each cell (with
    >readonly=true). Then you can size the text box to the

    width you prefer and
    >any overflow text will be cut off. Also, each line will

    be a single row
    >with no wrapping. Finally, a user can view overflow text

    by clicking inside
    >the text box and selecting the text.
    >
    >Does this answer your question?
    >
    >Thank you, Mike Moore
    >Microsoft, ASP.NET
    >
    >This posting is provided "AS IS", with no warranties,

    and confers no rights.
    >
    >--------------------
    >>Content-Class: urn:content-classes:message
    >>From: "TPSreport" <>
    >>Sender: "TPSreport" <>
    >>Subject: consistent column widths
    >>Date: Thu, 4 Sep 2003 08:39:43 -0700
    >>Lines: 19
    >>Message-ID: <1e8401c372fa$c3063420$>
    >>MIME-Version: 1.0
    >>Content-Type: text/plain;
    >> charset="iso-8859-1"
    >>Content-Transfer-Encoding: 7bit
    >>X-Newsreader: Microsoft CDO for Windows 2000
    >>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    >>Thread-Index: AcNy+sMG6+dXIBZvSCWJUW2x9zSZQA==
    >>Newsgroups:

    microsoft.public.dotnet.framework.aspnet.datagridcontrol
    >>Path: cpmsftngxa06.phx.gbl
    >>Xref: cpmsftngxa06.phx.gbl

    >microsoft.public.dotnet.framework.aspnet.datagridcontrol:

    6501
    >>NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
    >>X-Tomcat-NG:

    microsoft.public.dotnet.framework.aspnet.datagridcontrol
    >>
    >>ASP.NET 2003. Two DataGrids, six columns each, one

    grid
    >>atop the other. I need to have the columns line up,
    >>i.e., DataGrid1 Col(1) lined up w/ DataGrid2 Col(1) -
    >>each the same width on the screen. All columns have

    the
    >>same width assigned via Property Builder, and both
    >>DataGrids themselves have the same total fixed width.
    >>Wrap is OFF for each column item because I can only
    >>afford the real estate for a single line; the users
    >>should have to highlight and drag-right to see any

    hidden
    >>text in a given cell.
    >>
    >>However, the text in (say) col(2) is variable in size

    and
    >>when the grids populate, col(2)'s width still expands

    or
    >>contracts. So DataGrid1 Col(2) is a different width

    than
    >>DataGrid2 Col(2) and it throws the alignment out of
    >>whack - even though I've hardcoded the column and
    >>DataGrid widths. Ideas? TIA.
    >>
    >>TPS
    >>

    >
    >.
    >
    TPSreport, Sep 12, 2003
    #3
    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. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    More Elegant Column Widths in ASP:Table Objects?

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, May 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    552
    Jason DeFontes
    May 14, 2004
  2. sck10

    Data Grid Column Widths

    sck10, Nov 8, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    7,730
    Steven Cheng[MSFT]
    Nov 15, 2004
  3. wh1974
    Replies:
    1
    Views:
    1,574
    =?Utf-8?B?RmVybmFuZG8gSHVudGg=?=
    Jan 11, 2005
  4. =?Utf-8?B?RWxtZXI=?=

    Datagrid column widths in edit mode

    =?Utf-8?B?RWxtZXI=?=, Apr 8, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,428
    =?Utf-8?B?RWxtZXI=?=
    Apr 19, 2005
  5. Rachel Devons

    Setting column widths in DataList?

    Rachel Devons, Jun 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,000
    Eliyahu Goldin
    Jun 19, 2005
Loading...

Share This Page