Use the ListView Items editor at design time to add or delete the items displayed in a listview component. You can add or delete new items and sub-items, and you can set the caption and image index for each item in the ListView Items editor.
To display the ListView Items editor, select the TListView object and double-click the Items property value in the Object Inspector.
The ListView Items editor contains an Items group box with an Items list box, a New Item button, a New SubItem button, and a Delete button. When you first add a listview control to a form, the Items list box is empty and the New SubItem and Delete buttons are disabled. When you enter or change item properties for a selected item, the Apply button is enabled so that you can activate changes immediately.
The ListView Items editor also contains an Item Properties group box for setting the properties of the listview item currently selected in the Items list box. The Item Properties group box contains a Caption edit box and an Image Index edit box.
Create and delete listview items and subitems in the Items group box. To create a new item, click New Item. A default item caption appears in the Items list box. Specify an item's properties, including its caption, in the Items Properties group box. When you create a new item, or select an existing item, the New SubItem button is enabled so that you can nest items within other items in the listview. If the Items list box contains items, the Delete button is also enabled. To delete an item, select it in the Items list box and click Delete.
Set the properties for a selected item in the Item Properties group box. Enter a name for the item in the Caption edit box. As you enter the name, it changes in the Items list box.
To display an image to the left of an item that is not currently selected, specify the index number of the image in the Image Index edit box. The index is zero-based. To suppress image display, set Image Index to -1 (the default).
To display an additional image to the left of an item, specify the index number of the image in the State Index edit box. The index is zero-based. To suppress image display, set State Index to -1 (the default).
To indicate which group an item belongs to, select the group in the Group list box, which lists all the groups. Choose -1 for the item to belong to no group.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!