GridView and Word Wrap in ASP.Net 2

G

Greg G.

I've messed with this for hours and cannot seem to find a solution.

I have a GridView control in a page, the columns have a set width,
which IE doesn't strictly obey, but the aggravating thing is the
inability to keep the lines from wrapping. I've tried:

white-space:nowrap
overflow: invisible

placed in both CSS and inline, but nothing works.

The reason for this is a really crowded grid is displayed, and some of
the fields have irrelevant information in the latter part of the
field.

I want to limit the display of the resulting (ASP generated) <td>
(table data) to the portion of the field constrained by the width
setting, and the reminder to remain invisible unless the client's
browser window is wide enough. No word wrap - at all, ever.

This works fine in FireFox, but no-can-do in IE. Any ideas?
I don't want to rewrite the functionality of the ASP.Net2 GridView
control, which generates tables for browser display instead of <DIV>s.

Thanks,

Dr. Know
 
M

Mike Brind

Greg said:
I've messed with this for hours and cannot seem to find a solution.

I have a GridView control in a page, the columns have a set width,
which IE doesn't strictly obey, but the aggravating thing is the
inability to keep the lines from wrapping. I've tried:

white-space:nowrap
overflow: invisible

placed in both CSS and inline, but nothing works.

The reason for this is a really crowded grid is displayed, and some of
the fields have irrelevant information in the latter part of the
field.

I want to limit the display of the resulting (ASP generated) <td>
(table data) to the portion of the field constrained by the width
setting, and the reminder to remain invisible unless the client's
browser window is wide enough. No word wrap - at all, ever.

This works fine in FireFox, but no-can-do in IE. Any ideas?
I don't want to rewrite the functionality of the ASP.Net2 GridView
control, which generates tables for browser display instead of <DIV>s.

Thanks,

Dr. Know

This group is for classic ASP. Dotnet is a different technology. Your
question is either a Dotnet question or a CSS question. It might be
both for all I know. Try these groups:

<url>microsoft.public.dotnet.framework.aspnet</url>
<url>comp.infosystems.www.authoring.stylesheets</url>
 
G

Greg G.

Mike Brind said:
This group is for classic ASP. Dotnet is a different technology. Your
question is either a Dotnet question or a CSS question. It might be
both for all I know. Try these groups:

<url>microsoft.public.dotnet.framework.aspnet</url>
<url>comp.infosystems.www.authoring.stylesheets</url>

Actually, it is relevant to MSIE, ASP.net server-side controls
generally, and the continuing incompatibilities of various browsers.
I had hoped that CSS would evenually eliminate that... Hah!

Since it was asked here, and I found the answer after wasting more
time - the answer is:

MSIE does not allow complex formatting on tables. Even though the ASP
control has a WRAP='false' method, it only works in Mozilla. (?!)

The solution (workaround) is to use "templates" in the control, which
then generates CSS.spans for the cell content. The generated table
cells will then conform to their content - which are the values
wrapped in <span>s. i.e.-nowrap and width...

Shoulda just written my own paginating server side control in ASP.
Too many post-backs in GridView to suit me for this particular need.
But it looked so neat in the demo...

FWIW,


Greg G.
 
M

Mike Brind

Greg said:
Mike Brind said:


Actually, it is relevant to MSIE, ASP.net server-side controls
generally, and the continuing incompatibilities of various browsers.

So it's got nothing to do with classic ASP. There are separate groups
for all the subjects you have listed. Posting to the correct group(s)
may have wasted less of your time.
 
G

Greg G.

Mike Brind said:
So it's got nothing to do with classic ASP. There are separate groups
for all the subjects you have listed. Posting to the correct group(s)
may have wasted less of your time.

Never said it did. As for my response, I generally follow-up on all
posts, in case another unfortunate soul is pondering the same
question. I have posted here before, albeit for infrequent cASP
problems and solutions. It was a matter of having subscribed to this
group and being familiar with it's players. Our ISP doesn't carry the
groups you mention, although I have since requested them.
I'm not about to use google. :-\

Thanks for the helpful response and the pointers to the new groups
dealing with the paradigm-shift of things similar in name alone.
I will utilize them in the future.


Greg G.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top