---
title: "deleteListViewItem"
canonical: "https://help.vicon.com/space/Shogun19/13795936/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/Shogun19/pages/13795754)
- [createListView](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13795876)
- [deleteAllListViewItems](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13795922)
- [getListViewItemCheck](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796156)
- [getListViewSelItems](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796160)
- [getNumListViewItems](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796192)
- [selectListViewItem](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796512)
- [setListViewColumns](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796608)
- [setListViewHandler](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796610)
- [setListViewItemCheck](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796612)
- [setListViewItemText](https://vicon-help.atlassian.net/wiki/spaces/Shogun19/pages/13796614)