Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > consistent column widths

Reply
Thread Tools

consistent column widths

 
 
TPSreport
Guest
Posts: n/a
 
      09-04-2003
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
 
Reply With Quote
 
 
 
 
Mike Moore [MSFT]
Guest
Posts: n/a
 
      09-04-2003
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" <(E-Mail Removed)>
>Sender: "TPSreport" <(E-Mail Removed)>
>Subject: consistent column widths
>Date: Thu, 4 Sep 2003 08:39:43 -0700
>Lines: 19
>Message-ID: <1e8401c372fa$c3063420$(E-Mail Removed)>
>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.datagridc ontrol
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.aspnet.datagridc ontrol:6501
>NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
>
>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
>


 
Reply With Quote
 
 
 
 
TPSreport
Guest
Posts: n/a
 
      09-12-2003
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" <(E-Mail Removed)>
>>Sender: "TPSreport" <(E-Mail Removed)>
>>Subject: consistent column widths
>>Date: Thu, 4 Sep 2003 08:39:43 -0700
>>Lines: 19
>>Message-ID: <1e8401c372fa$c3063420$(E-Mail Removed)>
>>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.datagridc ontrol
>>Path: cpmsftngxa06.phx.gbl
>>Xref: cpmsftngxa06.phx.gbl

>microsoft.public.dotnet.framework.aspnet.datagrid control:

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

microsoft.public.dotnet.framework.aspnet.datagridc ontrol
>>
>>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
>>

>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(const char *cp) and (char *p) are consistent type, (const char **cpp) and (char **pp) are not consistent lovecreatesbeauty C Programming 1 05-09-2006 08:01 AM
Datagrid column widths in edit mode =?Utf-8?B?RWxtZXI=?= ASP .Net 4 04-19-2005 12:25 AM
datagrid column widths - remember after postback wh1974 ASP .Net 1 01-11-2005 04:13 PM
Data Grid Column Widths sck10 ASP .Net 3 11-15-2004 12:39 PM
More Elegant Column Widths in ASP:Table Objects? =?Utf-8?B?QWxleCBNYWdoZW4=?= ASP .Net 1 05-14-2004 07:38 PM



Advertisments