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

5 posts, 1 answers
  1. Vasssek
    Vasssek avatar
    185 posts
    Member since:
    Aug 2010

    Posted 01 May 2012 Link to this post

    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
  2. Answer
    Richard
    Richard avatar
    479 posts
    Member since:
    Nov 2011

    Posted 03 May 2012 Link to this post

    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!
  3. Vasssek
    Vasssek avatar
    185 posts
    Member since:
    Aug 2010

    Posted 03 May 2012 Link to this post

    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
  4. James
    James avatar
    1 posts
    Member since:
    Sep 2014

    Posted 06 Nov 2015 Link to this post

    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.
  5. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 11 Nov 2015 Link to this post

    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
Back to Top