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

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?
 
M

Miha Markic [MVP C#]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top