This sample shows how to create expression fields through the designer.
Features
Interactive Features
To create an expression column, select TableDescriptor -> ExpressionFields in the Properties window. This will display the ExpressionFieldDescriptor Collection Editor, as shown in the following image.
Click Add, to add an expression field.
Specify a field name and result type. Then enter the required
expression in the Expression property.
The
following image illustrates this.
Add one more expression field, Lossing%, as shown below.
Close the editor window to see the effect of the new
expression fields. You will notice that, in addition to adding an entry to
the ExpressionFields collection, two more new entries would have been
added to the Columns collection.
Here is the image
that illustrates this.
You can also make use of ExpressionFieldEvaluator class to set expression for ExpressionFields through custom function referring other column values.