Don't allow the to wrap the data in radgrid cell

6 posts, 0 answers
  1. Hrushikesh Mokashi
    Hrushikesh Mokashi avatar
    172 posts
    Member since:
    Dec 2007

    Posted 25 Feb 2009 Link to this post

    Hi All,

    I am using radgrid and VS2008.

    I want to show the data in grid in one line row.
    Currently it expand the cell and row height according to the data.
    I want to show the data in in line row . if data is greater then it will show the '...'.
    How can it achieve?

    I have tried the implement css which run in VS2005 for gridview.
     td { word-wrap: break-word; text-overflow:ellipsis; overflow:hidden; white-space:nowrap; }

    in VS2008 this css doesn't work.

    Or there is way to set the grid css?


  2. Daniel
    Daniel avatar
    4934 posts

    Posted 25 Feb 2009 Link to this post

    Hello Hrushikesh,

    I recommend you examine the appropriate article in our documentation:
    No wrap for grid cell content

    Also you can set overflow: hidden to prevent the text wrapping.
    <style type="text/css"
        .MasterTable_SkinName td 

    Best regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft R3 2016 release webinar banner
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Feb 2009 Link to this post

    Hi Hrushikesh,

    One suggestion is applying DataFormatString in order to prevent text wrapping.
    <telerik:GridBoundColumn DataField="ShipName" HeaderText="ShipName" UniqueName="ShipName" DataFormatString="<nobr>{0}</nobr>">   

    Another option is by setting the ItemStyle of the column. But for the wrap to take place properly make sure that the cell text contains white space in between. Also set the TableLayout to Fixed so that wrapping will occur in accordance with column resizing.
    <MasterTableView TableLayout="Fixed" datasourceid="SqlDataSource1" > 
             . . .  
            <telerik:GridBoundColumn DataField="ShipName" HeaderText="ShipName" SortExpression="ShipName" UniqueName="ShipName">  
                 <ItemStyle Wrap="false" Width="50px"  />  

    Refer the following documentation for more information about preventing wraping for grid cell.
    No wrap for grid cell content

  5. DoomerDGR8
    DoomerDGR8 avatar
    133 posts
    Member since:
    Aug 2010

    Posted 10 Nov 2010 Link to this post

    Hello Daniel,

    You purposed solution is the only way for me to go as I'm extensively applying DataFormats in all the RadGrids I'm using site-wide (over 45 now). Here is the code from a CSS file called SiteStyles.Grid.scc:

    .MasterTable_Office2007 td {
      overflow: hidden;
      /* white-space: nowrap; */
    .GridHeader_Office2007 {
      overflow: hidden;

    Office2007 is the site's style. Kindly advise why wrapping is still in effect. Thank you.
  6. TurtleBoy
    TurtleBoy avatar
    1 posts
    Member since:
    Jul 2007

    Posted 10 Apr in reply to Hrushikesh Mokashi Link to this post

    The answer I found was to add the max-width property to the css:

    I have used:

        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;


    This has given me what Hrushikesh seemed to be asking about.

  7. Eyup
    Eyup avatar
    2941 posts

    Posted 13 Apr Link to this post


    Thank you for sharing your approach with our community. I'm also attaching a sample RadGrid web site to demonstrate this implementation.

    You can also display the text as a link and show some kind of pop-up mechanism to display the full text on user hover. Please check the options suggested here:

    Alternatively, you can use a GridTemplateColumn and place the full text within scrollable divs with fixed overall width:

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
DevCraft R3 2016 release webinar banner