Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
480
Exporing grid text column with numbers to excel
posted

Hi,

  I have a grid with a column that contains values such as: 001 , 012 , 015 when I exprt to excel the pasted values are: 1,12,15.

  How can I keep the original values when exporting to excel? (As string)

  Thank you in advance,

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    What data type is the column in the grid? My guess is that it's a numeric type and you are using the Format property on the column to format it. Or possibly the MaskInput property.

    The Formats in Dotnet are not the same as the ones in Excel. So if you are using Format, then what you should do is handle the InitializeColumn event of the UltraGridExcelExporter and translate the format into an Excel format and assign the format to the excel column. If I recall, the event args will expose this for you.

    Another option would be to handle the CellExported event of the UltraGridExcelExporter and format the value yourself and write it into the cell how you want it.  

Children