How about DataCloumn.Expression
-
Has a 'dataGrid1' and assign to 'dataTable1', 'dataTable1' have 3 columns: Col1,Col2,Col3, and then: Col1.ColumnName = "Col1"; Col2.ColumnName = "Col2"; Col3.ColumnName = "Col3"; Col1.DataType = System.Decimal; Col2.DataType = System.Int32; Col3.DataType = System.Decimal; Col3.Expression = "Col1 * Col2"; Col3.ReadOnly = true; // it's auto set Why at runtime, edit Col1, Col2 of the 'dataTable1' and then leave to other row, but Col3's value has not change yet, has not any be computed? Additional: I had try to new a 'dataRow1', and then give value to dataRow1[0], dataRow1[1], and at last 'Add()' this row in 'dataTable1'. At this time, run dataTable1.Refresh() and found that 'Col3' shown correct. Why at this time the Expression could be used. :confused::(( Why learn more, unaware more?