This is a migrated thread and some comments may be shown as answers.

export to excel wrapping data in cells

1 Answer 225 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erwin Floresca
Top achievements
Rank 1
Erwin Floresca asked on 30 Sep 2010, 04:08 PM
Hi,

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.

Thanks,
Sridhar.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 06 Oct 2010, 04:32 PM
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,
Daniel
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
Tags
Grid
Asked by
Erwin Floresca
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or