after dataset.merge(..) datacolumn.expression is not working?

  • Thread starter Thread starter Giedrius
  • Start date Start date
G

Giedrius

hello,
I have a typed dataset, with tables where some columns are with expressions
like
.CaptionColumn.Expression = "ISNULL([Alias], [Name])"

After doing

DataGrid.DataSource = MyTypedDataSet
DataGrid.DataMember = "Table"

newDataSet = Me.GetData()
MyTypedDataSet.Clear
MyTypedDataSet.Merge(newDataSet, "Table")
MyTypedDataSet.AcceptChanges

Columns with expressions are not calculated, and viewing in Grid show only
blank space in these columns.
However exporting to XML, or resetting .Expression = .Expression, helps.

So am I missing something after merging data or this is by design?
 
Hi,

I would avoid using Expressions in non-readonly scenarios as there are some
problems.
Rather do the expressions yourself (use DataTable events to fill the fields)
and AcceptChanges on row if it was unchanged before.
 
Back
Top