D
Doron Grinstein
I am looking for an elegant way to have a calculated field in a
DataTable. Using the Column.Expression property appears to be limited
to simple expressions. An example of where this might be necessary
follows:
Suppose we have 2 tables - Order and OrderStatus. In Order we have a
field called StatusId. OrderStatus has two fields: StatusId and
StatusDesc. Now, we want to provide a DataGrid that lists all Orders
and displays their Status Description and not their Id.
Using a calculated field that isn't restricted using Expression's
limited functionality would allow us to do a second dataset lookup to
derive the desired value (StatusDesc).
This functionality is elegantly exposed in Delphi using an event
handler OnCalcField, but I cannot see a similar mechanism in ADO.Net.
DataTable. Using the Column.Expression property appears to be limited
to simple expressions. An example of where this might be necessary
follows:
Suppose we have 2 tables - Order and OrderStatus. In Order we have a
field called StatusId. OrderStatus has two fields: StatusId and
StatusDesc. Now, we want to provide a DataGrid that lists all Orders
and displays their Status Description and not their Id.
Using a calculated field that isn't restricted using Expression's
limited functionality would allow us to do a second dataset lookup to
derive the desired value (StatusDesc).
This functionality is elegantly exposed in Delphi using an event
handler OnCalcField, but I cannot see a similar mechanism in ADO.Net.