deloused
asked on
Gridview number format disappears on export to excel
I am trying to export a gridview to excel with the same formatting that is in my gridview but my formatting is stripped out on the export.
I am loading a gridview with ObjectDataSource. In the ObjectDataSource I load the data into a dataset with some custom string formating like this:
GridViewField = string.Format("{0:0000000} .{1:00}", numberOne, numberTwo);
It works fine when I view my gridview in the web browser but when I export to excel the numbers are not with this formatting. How can I force the formatting to be the same for the export to excel?
I am loading a gridview with ObjectDataSource. In the ObjectDataSource I load the data into a dataset with some custom string formating like this:
GridViewField = string.Format("{0:0000000}
It works fine when I view my gridview in the web browser but when I export to excel the numbers are not with this formatting. How can I force the formatting to be the same for the export to excel?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found it!
http://geekswithblogs.net/AzamSharp/archive/2006/08/12/87804.aspx
needo_jee, you gave me the correct idea to search and this article further explains how to use it with a gridview like I needed. Thanks for your help!
http://geekswithblogs.net/AzamSharp/archive/2006/08/12/87804.aspx
needo_jee, you gave me the correct idea to search and this article further explains how to use it with a gridview like I needed. Thanks for your help!
~welcome
ASKER