We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Format string with zero's?

Thread ID:





116922 Jul 1,2014 03:45 AM Jul 2,2014 06:58 AM Windows Forms 1
Tags: XlsIO
Asked On July 1, 2014 03:45 AM

Hi, im trying to format a string like 000055555 in a excel sheet. But its is imposible, the excel generated show the string as number like this.


My code is this, 

        sheet.Columns[10].CellStyle.NumberFormat = "@";



Prakash Kumar D [Syncfusion]
Replied On July 2, 2014 06:58 AM

Hi Carlos,


We suspect this as a usage issue. You might have used Value or Value2 property instead of Text property. Value or Value2 property converts the data type as per value in the cell. In your scenario, number “00005555” is trying to store as text initially and the number format is applied. So, the value is already converted to number while assigning, and the cell type is changes to Text later. We recommend to use the Text property in order to get the issue resolved. We have attached the code snippet for your reference.


Code Snippet:


sheet["A1"].Text = "000055555";

sheet.Columns[0].CellStyle.NumberFormat = "@";






This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.