ComponentOne Expression Editor for WPF
Create Expressions

Expression Editor enables creating and editing complex expressions at run-time. It provides Excel-like formulas, in the form of functions as well as operators and constants that help in shaping data using expressions.

To create expressions, use any of the following ways:

Note that variables are enclosed in square brackets [].

Some examples of creating expressions using in-built functions and operators are as follows.

Using Logical and Aggregate Functions Description
     Iif([Price] + [Cost]) > 500,300,400) This expression evaluates the two constants 300 and 400 based on the condition provided by the expression "([Price] + [Cost]) > 500".
           
     IsNull([Sales]) This expression evaluates whether Sales are null.
Using DateTimeFunctions Description
     AddDays([OrderDate], 30) This expression adds the number of days equivalent to integer value 30 to the OrderDate value of the type DateTime.
     DateDiffDay([DateStart], [DateEnd]) This expression counts the number of days between DateStart and DateEnd.
Using Math Functions Description
     Sign([Value]) This expression returns the integer value indicating the sign of the provided Value.
     Exp([Value]) This expression calculates and returns the base of natural logarithms raised to the power Value.
Using String Functions Description
    Mid([Name],0,4) This expression returns a string of specified number of 4 characters from the beginning of the specified [Name] string.
     Remove([Name], 0, 3) This expression removes specified number of 3 characters from the beginning of the string specified as 0. 
See Also