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

grid excel export date column width

1 Answer 292 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Veteran
Daniel asked on 12 May 2020, 01:43 AM

Hi,

Why is the column width of the export extra wide when exporting a date type?

 

https://stackblitz.com/edit/react-tfamno

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 12 May 2020, 01:34 PM

Hello, Daniel,

Thank you for your example.

This occurs as the column will expand based on the content and it this case the content is "Tue May 12 2020 08:05:34 GMT+0300 (Eastern European Summer Time)". Excel just formats it as a date automatically. We set the width of the generated columns based on the actual content passed to it, no based on how it will be formated, as every Excel is different and can format it differently based on the region and other settings.

In this case, we can set a width to the column to ensure that it won't be that large:

https://stackblitz.com/edit/react-tfamno-rdopx4?file=app%2Fmain.jsx

Regards,
Stefan
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Daniel
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Share this question
or