共用方式為


Display Calculated Values in a Column

File: ...\Samples\Solution\Controls\Grid\Calc.scx

This sample illustrates how to display a calculated value in a column.

Set the ControlSource property of the column to an expression with a calculation. For example, the following expression for the ControlSource of the Profit column displays the difference between the price and cost.

Products.Unit_Price - Products.Unit_Cost

When you change one or more values in the expression, the value in the column is automatically updated.

Note   Columns that display an expression containing a calculation are read-only.

See Also

Solutions Samples | Visual FoxPro Foundation Classes A-Z