Datagrid column width and truncating ...

Datagrid column width and truncating ...

am 09.01.2008 10:52:45 von francois

Hello,

How can I size my text to fit in a datagrid column ? I do not want the
datagrid go multiline.

I am using WEB Forms, not windows form, so CreateGraphics ans MesasureString
do not work.


Thanks.

Re: Datagrid column width and truncating ...

am 09.01.2008 11:06:12 von Eliyahu Goldin

Try using css rule white-space: nowrap. It is also available on server side
as Wrap property in style parameters. You can also consider using
non-breaking spaces characters  .

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Francois" wrote in message
news:u3vWVVqUIHA.4476@TK2MSFTNGP06.phx.gbl...
> Hello,
>
> How can I size my text to fit in a datagrid column ? I do not want the
> datagrid go multiline.
>
> I am using WEB Forms, not windows form, so CreateGraphics ans
> MesasureString do not work.
>
>
> Thanks.
>

Re: Datagrid column width and truncating ...

am 09.01.2008 12:53:52 von francois

Thanks a lot.

This has helped me to avoid multiline breaks. But now, the column is sized
to the longest text. I would like to size myself the column width, and the
text being clipped. I have tried overflow:hidden or owerflow-x:hidden, but
could not get it working. So I would like to cut the string in code (full
string displayed in the tootip). But I need to know the pixel lenght of the
string. iii not same size as mmm.

Francois.

"Eliyahu Goldin" a écrit dans le
message de news: eS%23EedqUIHA.3916@TK2MSFTNGP02.phx.gbl...
> Try using css rule white-space: nowrap. It is also available on server
> side as Wrap property in style parameters. You can also consider using
> non-breaking spaces characters  .
>
> --
> Eliyahu Goldin,
> Software Developer
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
> http://usableasp.net
>
>
> "Francois" wrote in message
> news:u3vWVVqUIHA.4476@TK2MSFTNGP06.phx.gbl...
>> Hello,
>>
>> How can I size my text to fit in a datagrid column ? I do not want the
>> datagrid go multiline.
>>
>> I am using WEB Forms, not windows form, so CreateGraphics ans
>> MesasureString do not work.
>>
>>
>> Thanks.
>>
>
>

Re: Datagrid column width and truncating ...

am 09.01.2008 13:26:41 von Eliyahu Goldin

It is difficult to be precise in pixels since you don't have control over
client browser settings. A better idea would be to compromise and to
truncate the strings to a fixed character length.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Francois" wrote in message
news:erpcAZrUIHA.5164@TK2MSFTNGP03.phx.gbl...
> Thanks a lot.
>
> This has helped me to avoid multiline breaks. But now, the column is sized
> to the longest text. I would like to size myself the column width, and the
> text being clipped. I have tried overflow:hidden or owerflow-x:hidden, but
> could not get it working. So I would like to cut the string in code (full
> string displayed in the tootip). But I need to know the pixel lenght of
> the string. iii not same size as mmm.
>
> Francois.
>
> "Eliyahu Goldin" a écrit dans
> le message de news: eS%23EedqUIHA.3916@TK2MSFTNGP02.phx.gbl...
>> Try using css rule white-space: nowrap. It is also available on server
>> side as Wrap property in style parameters. You can also consider using
>> non-breaking spaces characters  .
>>
>> --
>> Eliyahu Goldin,
>> Software Developer
>> Microsoft MVP [ASP.NET]
>> http://msmvps.com/blogs/egoldin
>> http://usableasp.net
>>
>>
>> "Francois" wrote in message
>> news:u3vWVVqUIHA.4476@TK2MSFTNGP06.phx.gbl...
>>> Hello,
>>>
>>> How can I size my text to fit in a datagrid column ? I do not want the
>>> datagrid go multiline.
>>>
>>> I am using WEB Forms, not windows form, so CreateGraphics ans
>>> MesasureString do not work.
>>>
>>>
>>> Thanks.
>>>
>>
>>
>
>