ICtrlGroupConditions.AddRow

Syntax

AddRow(Value: ConditionOperatorType): IListViewItem;

None;

Parameters

Value. The statement that will be used in the expression when the element to be added is grouped with another component element.

Description

The AddRow method adds an element.

Comments

The element is added with the specified expression after all existing elements in the component.

To add an element by the specified index, use the ICtrlGroupConditions.InsertRow method.

To group the selected elements, use the ICtrlGroupConditions.Group method.

To group elements by index, use the ICtrlGroupConditions.GroupByIndexes method.

Example

To execute the example, add on the form the CtrlGroupConditions component named CtrlGroupConditions1.

Add a link to the Forms system assembly.

The example is a handler of the OnCreate event for the form.

Sub TESTFormOnCreate(Sender: Object; Args: IEventArgs);
Var
    Columns: IListViewColumns;
    Attr, Condition, Value: IListViewColumn;
    AttrEditBox, AttrEditBox2, AttrEditBox3, AttrEditBox4: IEditBox;
    List, List2, List3: ITreeCombo;
    Date: IDateTimePicker;
    ValueEdit: IIntegerEdit;
Begin
    
// Determine columns
    Columns := CtrlGroupConditions1.Columns;
    Attr := Columns.Add;
    Attr.Caption := 
"Attribute";
    Condition := Columns.Add;
    Condition.Caption := 
"Condition";
    Value := Columns.Add;
    Value.Caption := 
"Value";

    
// Add the first element
    CtrlGroupConditions1.AddRow(ConditionOperatorType.Or_);
    
// Add a visual component for the Attribute column
    AttrEditBox := New EditBox.Create;
    AttrEditBox.Text := 
"DATE";
    CtrlGroupConditions1.InsertControl(AttrEditBox, 
20);
    
// Add a visual component for the Condition column
    List := New TreeCombo.Create;
    List.Nodes.Add(
Null"Equal").Selected := True;
    List.Nodes.Add(
Null"Not equal");
    List.Nodes.Add(
Null"Less");
    List.Nodes.Add(
Null"Greater");
    List.Nodes.Add(
Null"Less or equal");
    List.Nodes.Add(
Null"Greater or equal");
    List.SelectionMode := SelectionModeType.SingleSelect;
    CtrlGroupConditions1.InsertControl(List, 
30);
    
// Add a visual component for the Value column
    Date := New DateTimePicker.Create;
    CtrlGroupConditions1.InsertControl(Date, 
40);

    
// Add the second element
    CtrlGroupConditions1.AddRow(ConditionOperatorType.Or_);
    
// Add a visual component for the Attribute column
    AttrEditBox2 := New EditBox.Create;
    AttrEditBox2.Text := 
"NAME";
    CtrlGroupConditions1.InsertControl(AttrEditBox2, 
21);
    
// Add a visual component for the Condition column
    List2 := New TreeCombo.Create;
    List2.Nodes.Add(
Null"Equal").Selected := True;
    List2.Nodes.Add(
Null"Not equal");
    List2.Nodes.Add(
Null"Less");
    List2.Nodes.Add(
Null"Greater");
    List2.Nodes.Add(
Null"Less or equal");
    List2.Nodes.Add(
Null"Greater or equal");
    List2.SelectionMode := SelectionModeType.SingleSelect;
    CtrlGroupConditions1.InsertControl(List2, 
31);
    
// Add a visual component for the Value column
    AttrEditBox3 := New EditBox.Create;
    AttrEditBox3.Text := 
"Report";
    CtrlGroupConditions1.InsertControl(AttrEditBox3, 
41);

    
// Add the third element
    CtrlGroupConditions1.AddRow(ConditionOperatorType.Or_);
    
// Add a visual component for the Attribute column
    AttrEditBox4 := New EditBox.Create;
    AttrEditBox4.Text := 
"KEY";
    CtrlGroupConditions1.InsertControl(AttrEditBox4, 
22);
    
// Add a visual component for the Condition column
    List3 := New TreeCombo.Create;
    List3.Nodes.Add(
Null"Equal").Selected := True;
    List3.Nodes.Add(
Null"Not equal");
    List3.Nodes.Add(
Null"Less");
    List3.Nodes.Add(
Null"Greater");
    List3.Nodes.Add(
Null"Less or equal");
    List3.Nodes.Add(
Null"Greater or equal");
    List3.SelectionMode := SelectionModeType.SingleSelect;
    CtrlGroupConditions1.InsertControl(List3, 
32);
    
// Add a visual component for the Value column
    ValueEdit := New IntegerEdit.Create;
    ValueEdit.Value := 
12345;
    CtrlGroupConditions1.InsertControl(ValueEdit, 
42);
End Sub TESTFormOnCreate;

None.

After executing the example, columns are determined and three elements with visual components are added in the CtrlGroupConditions component:

See also:

ICtrlGroupConditions