Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when exporting grid view to excel i want to change the format of a single column to custom number format with a length of 4 i.e

if value is 10 it is stored in excel cell as 0010
if value is 100 then it will be stored as 0100
if it is 1000 then it will be stored as 1000

What style should i add or what format should i add in my .aspx page before export
Posted

1 solution

String.Format("{0:0000}", value);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900