Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

DataTable Expression Column

My DataGrid is bound to a DataSet, with following columns: Description, CashExp, CreditExp, Frequency

On run time, I am adding two new DataColumn "AnnualCash" and "AnnualCredit" and defining Expression property to give product of two columns, as follows:

Dim dc As DataColumn
dc = New DataColumn("AnnualCash", GetType(System.Single))
dc.Expression = "CashExp * Frequency"
myDataSet.Tables("ClientExpenses").Columns.Add(dc)

dc = New DataColumn("AnnualCredit", GetType(System.Single))
dc.Expression = "CreditExp * Frequency"
myDataSet.Tables("ClientExpenses").Columns.Add(dc)

The only problem is when CashExp or CreditExp or Frequency is changed the value of derived column is not changed (calculated), until user changes the row either by tab or arrow keys.

Is there a way to change this behaviour so that the derived columns gets calculated when user is editing value in the cell.

Sign In or Register to comment.