prevent cell wrap

Discussion in 'ASP .Net Building Controls' started by Bobby, Apr 2, 2004.

  1. Bobby

    Bobby Guest

    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?


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Bobby, Apr 2, 2004
    #1
    1. Advertising

  2. Bobby

    Bruce Guest

    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"
    />



    Bobby <> wrote in message news:<#>...
    > 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?
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Bruce, Apr 28, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GregG
    Replies:
    0
    Views:
    5,603
    GregG
    Mar 16, 2006
  2. Aaron Fude

    To wrap or not to wrap?

    Aaron Fude, May 8, 2008, in forum: Java
    Replies:
    12
    Views:
    693
    Chronic Philharmonic
    May 10, 2008
  3. Eric

    Prevent RadioButton Item word wrap

    Eric, May 20, 2004, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    477
    Sareen
    May 26, 2004
  4. Art Werschulz

    Text::Wrap::wrap difference

    Art Werschulz, Sep 22, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    226
    Art Werschulz
    Sep 22, 2003
  5. Art Werschulz

    Text::Wrap::wrap difference

    Art Werschulz, Sep 24, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    241
    Anno Siegel
    Sep 25, 2003
Loading...

Share This Page