Datagrid Currency Column??
-
Is there a style or built in way of having a data grid column show a double or decimal as a currency, or am I going to have to create a custom column? Thanks!!
Explicitly define a
DataGridTableStyle
in theDataGrid.TableStyles
for your table (or collection) and add aDataGridTextBoxColumn
for that currency column. Set theFormat
property to "c". The values set in theFormat
property are the format specifiers for the Type of theDataColumn
(or property) you bind your column style to. So, if you look at the documentation for theNumberFormatInfo
, you'll see that "c" or "C" formats the number using the culture-specific currency format.Microsoft MVP, Visual C# My Articles
-
Explicitly define a
DataGridTableStyle
in theDataGrid.TableStyles
for your table (or collection) and add aDataGridTextBoxColumn
for that currency column. Set theFormat
property to "c". The values set in theFormat
property are the format specifiers for the Type of theDataColumn
(or property) you bind your column style to. So, if you look at the documentation for theNumberFormatInfo
, you'll see that "c" or "C" formats the number using the culture-specific currency format.Microsoft MVP, Visual C# My Articles