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

Export to Excel - Cell Content is too Wide to Fit in the Column...

4 Answers 721 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vasssek
Top achievements
Rank 1
Vasssek asked on 01 May 2012, 10:01 PM
Hello Telerik Team,

I have tried to export data from Radgrid via Excel-Format="ExcelML". The problem is, how to "autofit" column's width when cell content is too wide to fit in the column ? Normally in excel, user can double click between columns header and it automatically expands its width.
More info is here: http://www.launchexcel.com/column-width-autofit-keyboard/

The question is, how to do it from C# code ?

Thank you for your help.

Best regards.

Vasssek

4 Answers, 1 is accepted

Sort by
0
Accepted
Richard
Top achievements
Rank 1
answered on 03 May 2012, 07:10 PM
Vasssek:

If you have not already seen this, I'd suggest that you reference the How to fix column size after exporting to excel forum thread. It provides the needed insights into how to solve your requirement.

Hope this helps!
0
Vasssek
Top achievements
Rank 1
answered on 03 May 2012, 09:22 PM
Hmm,

thank you for that thread. It helped me to understand, how xml formatting works. In my case, I have a header row where each column has different width based on header caption. I want to expand (autofit) columns based on length of next row values.

Because of xml restrictions, It seems not to be done on text columns :(.

Vasssek
0
James
Top achievements
Rank 1
answered on 06 Nov 2015, 05:52 PM
Please note that the thread link for "how to fix column size after exporting to Excel" no longer works.  :(  It would be very handy to have that information.
0
Kostadin
Telerik team
answered on 11 Nov 2015, 12:18 PM
Hi James,

You can check out the following forum thread which describes how to apply auto fit height of the excel document. The same approach is use to apply auto fit width but you need to use ss:AutoFitWidth.

Regards,
Kostadin
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Vasssek
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Vasssek
Top achievements
Rank 1
James
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or