---
title: "deleteListViewItem"
canonical: "https://help.vicon.com/space/Shogun112/31229521/deleteListViewItem"
format: markdown
---
# Description

Deletes an item from a list view user control

## Functional area

User Window

# Command syntax

## Syntax

|  |
| --- |
| `deleteListViewItem userControlID itemIndex or "itemString"` |

### Arguments

> Macro (scroll-tablelayout)

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `userControlID` | integer | yes | ID of user control item to operate on |
| `itemIndex` | any | yes | Value can either be a string or an integer. If it is a string, all items matching the string value will be removed (i.e. multiple items may be removed). If the value is an integer, the item at the (zero-based) index will be removed. If the index is out of range (i.e. below zero or more than the number of items in the list view, the command will fail. |

### Flags

None

## Return value

integer

Returns the number of items left in the list view user control 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Deletes some items from a List View we created earlier.
int $listViewID = `getGlobalIntVar "MyListViewID"`;
 
// Deletes the 4th item (indices are zero-based)
deleteListViewItem $listViewID 3;
 
// Deletes all items whose first column value is "Mary"
deleteListViewItem $listViewID "Mary";
```

# Additional information

## Related commands

- [addListViewItem](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31230613)
- [createListView](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31237966)
- [deleteAllListViewItems](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31240130)
- [getListViewItemCheck](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31229480)
- [getListViewSelItems](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31237682)
- [getNumListViewItems](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31231109)
- [selectListViewItem](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31238946)
- [setListViewColumns](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31239215)
- [setListViewHandler](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31235184)
- [setListViewItemCheck](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31239447)
- [setListViewItemText](https://vicon-help.atlassian.net/wiki/spaces/Shogun112/pages/31240432)