DataBinding an textbox to an Expression DataColumn



I have databind a textbox to a datacolumn that happen to be an
Strangely enough, when the calculated expression value changed, it
does not seems to update the textbox. Is it bug ?

I have tried to trap the changed event on the column but because it is
an expression, I never receive the changed event.
I've trapped the row and column event on the datatable and the
dataview and force a textboxInvalid, but it does not seems to refresh
Unless I manually clear the databinding and recreate, the textbox.Text
is never refreshed.
I've added a test datagrid to the the form and bind it to the
datatable containing the expression, and it is updated when using the
Any idea ?

Miha Markic [MVP C#]

Hi Valentin,

I suggest you to calculate and write the experssion yourself.


I could calculate myself the expression, but the overall idea of using
an expression datacolumn is that it recalculates itself without any
extra coding.

I am just surprised that the same expression value displayed in a
datagrid update itself, but when bind to a textbox, it does not.

I suspect that it may be bug, but I wanted to be sure that when
binding to an expressison datacolumn to a textbox, I did not need to
indicate somewhere to refresh automatically.

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