prevent cell wrap

B

Bobby

Hi,

I have a control that inherits from datagrid that has resizable columns.
when a column is sized smaller than the text length the overflow
attribute kicks in and displays an ellipsis for the hidden text.

My problem is that the text wraps unless I have a <nobr> tag in the
cell. I've tried <td nowrap>, <td nowrap="nowrap"> and adding it to the
style. The only thing that seems to work is <nobr> in the cell.

The problem is that I have to intercept the output and add the tag to
each cell, which is a bad way to do this. If I add the tag on the
InitializeCell() it gets overwritten later.

how can I set each cell in my grid to have this tag when it's written to
the browser; or how can I get nowrap to work properly?
 
B

Bruce

1. Create a class in your style sheet as this:
..result TD
{
WHITE-SPACE: nowrap
}

2. Apply this class to the datagrid as:
<ASP:DataGrid
id="ResultGrid"
runat="server"
cssclass="result"
/>
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top