IListView.InsertControl

Syntax

InsertControl(Control: IControl; Column: Integer; Row: Integer);

Parameters

Control is a component that should be inserted in the area of elements of the ListView component.

Column is an index of column in which the element should be inserted.

Row is an index of row in which the element should be inserted.

Description

The InsertControl method inserts a component in the area of elements of the ListView component.

Comments

This method is available for use, if the Style property is set to ListViewStyle.Report.

NOTE. The height of inserted component will match height of elements of the ListView component. The width of inserted component will match the width of corresponding column.

Example

Executing the example requires a form, a button named Button1 positioned on it and the ListView component named ListView1. Two columns and several elements were created for the ListView1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

c: ICheckBox;

i: Integer;

Begin

For i := 0 To ListView1.Items.Count - 1 Do

c := New CheckBox.Create;

c.Text := "Parameter " + i.ToString;

ListView1.InsertControl(c, 1, i);

End For;

ListView1.ItemHeight := 16;

End Sub Button1OnClick;

After executing the example pressing the button inserts the switches the second column of the ListView1 component in front of each element. The height of elements is 16.

See also:

IListView