Relation: FilterRelation;
The Relation property determines the logical connection of the condition with the following one.
Executing the example requires a form with the Button1 button, the DataGrid component named DataGrid1 and the UiDataSource component that is a data source for DataGrid.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
filter: ITableFilter;
filterItem: ITableFilterItem;
cond1, cond2: ITableFilterCondition;
Begin
filter := DataGrid1.TableFilter;
filterItem := filter.Item(0);
cond1 := filterItem.Conditions.Add;
cond1.Condition := FilterCondition.Less;
cond1.Value := 6;
cond1.Relation := FilterRelation.And_;
cond2 := filterItem.Conditions.Add;
cond2.Condition := FilterCondition.More;
cond2.Value := 2;
filterItem.State := FilterItemState.Condition;
End Sub Button1OnClick;
On clicking the Button1 button, the first column is filtered by condition: less than 6 and greater than 2 (the connection is used - unification by logical AND).
See also: