export to excel

4 posts, 0 answers
  1. Mahdi
    Mahdi avatar
    27 posts
    Member since:
    Oct 2013

    Posted 17 Aug 2016 Link to this post

    hello .I have a question about exporting a grid to excel

    I have a grid with one numeric column(INT 32) and I want to show the content of this cell with comma (Like 10,000) and when it will export to excel it shows exactly like the content (I mean 10,000 in grid and in excel both) And the main part is I want it will be numeric cell in excel not string cell.

    I have added this parts to column  :   DataType="System.Int32" DataFormatString="{0:n0}

    but after exporting, this cell format is not numeric .it is string and I should change it to numeric cell manualy . I want it in numeric format .

    Thanks in Advanced

  2. Doug
    Doug avatar
    104 posts
    Member since:
    Aug 2014

    Posted 17 Aug 2016 in reply to Mahdi Link to this post

    maybe try as an sample test to put a number in the header row for that column. with the first row sometimes excel will determine its format type.
  3. Mahdi
    Mahdi avatar
    27 posts
    Member since:
    Oct 2013

    Posted 20 Aug 2016 in reply to Doug Link to this post

    Hello Mr Doug

    Unfortunately it didn't work and My Problem still Exist. but I'm sure there is a Trick to solve This Problem

    Is There any  Other Solution(S)?

    Please help me





  4. Viktor Tachev
    Viktor Tachev avatar
    2497 posts

    Posted 22 Aug 2016 Link to this post


    In order for the values in the cells to be formatted correctly you need to ensure that the cell is formatted as number. Check out the following sample that illustrates how you can format the cells in the exported Excel file:

    Viktor Tachev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top