TX Text Control .NET for WPF

FilterInstruction Constructor

Constructor|Introduced in 26.0
Namespace
TXTextControl.DocumentServer.DataShaping
Package
TXTextControl.TextControl.WPF.SDK as TXDocumentServer.dll from the private NuGet feed or Text Control Offline Packages

Description

Initializes a new instance of the FilterInstruction class.

Syntax

FilterInstruction(string, RelationalOperator, object, LogicalOperator)

Sets the table column name to filter the data rows by, the comparison operator, the value to compare the table column content to and the logical operator.

public FilterInstruction(string columnName, RelationalOperator comparisonOperator, object compareTo, LogicalOperator logicalOperator);
ParameterDescription
columnName

The name of the table column to filter the data rows by.

comparisonOperator

The comparison operator.

ValueMeaning
Equals"Equals" relation.
NotEqual"Not equal" relation.
LessThan"Less than" relation.
GreaterThan"Greater than" relation.
GreaterThanOrEqualTo"Greater than or equal to" relation.
LessThanOrEqualTo"Less than or equal to" relation.
IsBlank"Is blank" constraint.
IsNotBlank"Is not blank" constraint.
compareTo

The value to compare the table column content to. If this value can be parsed to a numerical value, numerical comparisons are used internally when possible (i. e. when the table column contains numerical values, too). Otherwise the column content and this value are interpreted as strings.

logicalOperator

The logical operator which connects a filter instruction to the previous filter instruction in a collection.

ValueMeaning
AndLogical "and".
OrLogical "or".

FilterInstruction(string, RelationalOperator, object)

Sets the table column name to filter the data rows by, the comparison operator and the value to compare the table column content to. The logical operator is set to LogicalOperator.And.

public FilterInstruction(string columnName, RelationalOperator comparisonOperator, object compareTo);
ParameterDescription
columnName

The name of the table column to filter the data rows by.

comparisonOperator

The comparison operator.

ValueMeaning
Equals"Equals" relation.
NotEqual"Not equal" relation.
LessThan"Less than" relation.
GreaterThan"Greater than" relation.
GreaterThanOrEqualTo"Greater than or equal to" relation.
LessThanOrEqualTo"Less than or equal to" relation.
IsBlank"Is blank" constraint.
IsNotBlank"Is not blank" constraint.
compareTo

The value to compare the table column content to. If this value can be parsed to a numerical value, numerical comparisons are used internally when possible (i. e. when the table column contains numerical values, too). Otherwise the column content and this value are interpreted as strings.

FilterInstruction(string, RelationalOperator)

Sets the table column name to filter the data rows by and the comparison operator. The value to compare the table column content to is set to the empty string and the logical operator is set to LogicalOperator.And. This constructor is useful in cases of "is blank" or "is not blank" filter instructions because no compare value is needed in those cases.

public FilterInstruction(string columnName, RelationalOperator comparisonOperator);
ParameterDescription
columnName

The name of the table column to filter the data rows by.

comparisonOperator

The comparison operator.

ValueMeaning
Equals"Equals" relation.
NotEqual"Not equal" relation.
LessThan"Less than" relation.
GreaterThan"Greater than" relation.
GreaterThanOrEqualTo"Greater than or equal to" relation.
LessThanOrEqualTo"Less than or equal to" relation.
IsBlank"Is blank" constraint.
IsNotBlank"Is not blank" constraint.

Examples

The following example creates a Filter Instruction instance and configures its column name setting for a document workflow.

TXTextControl.DocumentServer.DataShaping.FilterInstruction filterInstruction = new("CustomerName", TXTextControl.DocumentServer.DataShaping.RelationalOperator.Equals);
filterInstruction.ColumnName = "CustomerName";