export to excel wrapping data in cells

2 posts, 0 answers
  1. Erwin Floresca
    Erwin Floresca avatar
    22 posts
    Member since:
    Dec 2009

    Posted 30 Sep 2010 Link to this post


    we are using the telerik grid's exporttoexcel() method to export the grid to excel. When it exports to excel, if a text is too long for the column it wraps the text. Is there a way to set the wrap to false? I tried setting the itemstyle.wrap = false but that didn't work.

  2. Daniel
    Daniel avatar
    4949 posts

    Posted 06 Oct 2010 Link to this post

    Hello Erwin,

    You should use set the white-space to nowrap in order to disable the automatic text wrapping.
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        if (e.Item is GridDataItem && isExport)
            e.Item.Style.Add("white-space", "nowrap");

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top