Has anyone got ellipses working in a gridview or detailsview?

R

RCS

Perhaps you are familiar with the old:

<nobr style="OVERFLOW:hidden;width:100px;TEXT-OVERFLOW:ellipsis">blah blah
blahblah blah blah blah</nobr>

technique.. Well, within a gridview, if I use this technique for a field, it
just sort of ignores it. If I isolate out this line in a seperate .html
file, it works as expected. Also, if I do a view source on the resultant
output from my .aspx page - it seems like it should work. For example, here
is the output:

<td nowrap="nowrap">
<nobr style="OVERFLOW:hidden;WIDTH:7­5px;TEXT-OVERFLOW:ellipsis"><a
href="RequestDetail.aspx?Request_ID=5">this is a long link that should be
shortened with ellipses at 75px, but it's not</a></nobr>
</td>

I've tried putting the logic into a css class and apply an ItemStyle for
it - also have tried nesting this different ways:

<span><nobr><a href></a></nobr>
<a href><nobr></nobr></a>

etc, etc... Anyone get this working or know of how I can?? Thanks much!
 
N

neilmcguigan

1. you'll probably want to handle the ItemDataBound event, and manually
put in the nobr and link there, in the correct order

2. i tried that technique and it didn't seem to work in Firefox. Is
there an xbrowser way to do it?

thx

Neil
 
R

RCS

Ugh. Well, after literally disassembling the output to almost 8 lines of
code - it turns out this line at the top:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Which I still don't know, what it does - if that line is present, this
feature breaks... just in case someone else runs across this...
 
J

Jeff User

I think the
//W3C//DTD XHTML 1.0 Trans...etc, etc...
refers to the standard by which the document should conform. Perhaps
<nobr> is not supported in that standard.
I would also be interested if anyone has any more info.
Jeff
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top