J
J
Is there anyway to format a calculated datacolumn? I would like the
following column to display as money (formatted as $#,##0.00). Or how about
simply displaying the column formatted as a number with only 2 decimals
(#,##0.00)?
In the sample below, amount and taxrate are existing DataColumn's.
DataColumn colTax = new DataColumn();
colTax.DataType = System.Type.GetType("System.String");
colTax.ColumnName = "tax";
myTable.Columns.Add(colTax);
colTax.Expression = "String.Format(\"{0:C}\",\"amount*taxrate\" )"; //error
: Expression does not support String.Format
following column to display as money (formatted as $#,##0.00). Or how about
simply displaying the column formatted as a number with only 2 decimals
(#,##0.00)?
In the sample below, amount and taxrate are existing DataColumn's.
DataColumn colTax = new DataColumn();
colTax.DataType = System.Type.GetType("System.String");
colTax.ColumnName = "tax";
myTable.Columns.Add(colTax);
colTax.Expression = "String.Format(\"{0:C}\",\"amount*taxrate\" )"; //error
: Expression does not support String.Format