formatting DataColumn.Expression

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J

    formatting DataColumn.Expression

    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.Get Type("System.St ring");
    colTax.ColumnNa me = "tax";
    myTable.Columns .Add(colTax);
    colTax.Expressi on = "String.Format( \"{0:C}\",\"amo unt*taxrate\" )"; //error
    : Expression does not support String.Format


Working...