Click here to Skip to main content
15,908,445 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am trying to format a decimal value in a datatable, I understand the best way to do this would be in the database and limit the amount of decimal places stored or in the query using the round function.

However, I cant change the table and the query was auto generated through nettiers and i cant change that.

Would much rather just create and run my own query but have been told i cant.

The datatable is used to build an ultragridview in code so there is no design code for it so i cant just add attributes.

My question is - Is there away to format a column in a datatable without creating a second datatable?
Posted
Comments
Member 9581488 7-Dec-12 16:12pm    
http://stackoverflow.com/questions/3209829/is-it-possible-to-format-a-date-column-of-a-datatable

Refer above link
Akbar Ali Hussain 7-Dec-12 18:06pm    
You don't need to format the dataTable content. Format the output when you display in the output.
DinoRondelly 7-Dec-12 18:08pm    
The gird is bound to the table so i am not pulling any values out
Rohit Shrivastava 7-Dec-12 18:39pm    
please refer http://stackoverflow.com/questions/4932150/expression-for-adding-computed-column-in-datatable-with-a-percentage-sign
Suresh Dasari's 18-Dec-12 7:20am    
Have a look at convert expression on this

http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression%28v=vs.100%29.aspx

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