Victor Garcia Aprea [MVP]
12/18/2002 8:50:00 AM
Hi Robert,
Have you tried something like this?
[C#]
if(str.Length>10)
str = str.Substring(0,10) + "...";
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
"Robert" <robert.dehmel@spk-pforzheim.de> wrote in message
news:5a78ef13.0212170735.69176c71@posting.google.com...
> Hi!
> I try to build a webcontrol, which displays some textstrings, read
> from a database, into a table's columns. Now, if the text is to large
> for the column, it its broken into several lines and the column is
> extended in height. If I set the nowrap-attribut for the column, the
> text is displayed in a single line, but the column will be extended in
> width. In this case, it is important, that the size of the tablecolumn
> are not changing. I am looking for some code, that will shorten the
> text when it is to large for its destination and add a couple of
> points to the end (e.g. "this is a very long text" will lead to "this
> is a very...")
>
>
> Any ideas?
> Thx, Robert