Version

Create(ComparisonOperator,Object,String,Boolean,Exception) Method

Creates a new ComparisonCondition instance based on the specified parameters.
Syntax
'Declaration
 
Public Overloads Shared Function Create( _
   ByVal comparisonOperator As ComparisonOperator, _
   ByVal operand As Object, _
   ByVal displayText As String, _
   ByVal validateOperand As Boolean, _
   ByRef error As Exception _
) As ComparisonCondition

Parameters

comparisonOperator
Comparison operator
operand
Comparison operand
displayText
The text to return from the ToString() method.
validateOperand
Whether to validate if the operand is valid for the specified comparison operator. If true and the operand is invalid, then null will be returned and error will be set to the error message. If false, a new ComparisonCondition will be returned with the specified operator and operand, even if the operand is invalid.
error
If the value is invalid, this will be set to an error instance that provides information about why the condition could not be created.

Return Value

New ComparisonCondition instance.
Remarks

Note: if DisplayText is supplied then the user will see the 'Equals' operator in a filter cell when this ComparisonCondition is selected. Also, if the operator is subsequently changed then the condition will be cleared. The reason for this behavior is that the display text may include context that is related to its own operator. Therefore, any additional operator displayed to the user (other than 'Equals') may be incorrect. For eaxmple, if the ComparisonCondition Operator was 'NotEquals', the Value was '0' and the DisplayText was 'None Zero'.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also