views:

629

answers:

2

Can I format the type of a datacolumn of a dataset to currency (for a specific culture) before binding it to the grid

A: 

You can set the DataFormatString property of the column to "C".

It should take the current culture into account when formatting. If this is for an application where the thread's culture wont be the user's culture than you have to do it manually as explained here.

colithium
I am looking something to change in dataset rather than a grid column property
If it's for display purposes then it should be done in the data grid. If it's a currency exchange issue (like $1 USD to ¥102 JPY) then that's a WHOLE different question.
colithium
I know it can be done in DataGrid but in this particular scenario I need to do it in the dataset.
+1  A: 

DataColumns support various types from the .Net system.

They are listed at MSDN. Currency is not a type in .Net. Usually Decimal is preferred for this use.

Guge