Help / WLanguage / WLanguage functions / Controls, pages and windows / List Box functions
  • Cascading deletions
  • Deleting an element on the browser
  • Miscellaneous
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Deletes an element from a List Box, ListView or Combo Box control populated programmatically.
Remark: ListDelete can be used on the single-selection and multi-selection List Box controls.
WEBDEV - Browser code Caution: The element will be deleted from the page displayed in the browser only. For more details, see Remarks.
// Delete the selected element from "LIST_CustomerList"
ListDelete(<List Box control> [, <Element index>])
<List Box control>: Control name
Name of List Box (or Combo Box) control to use. If this parameter corresponds to an empty string (""), the List Box control (or Combo Box) to which the current event belongs will be used.
WEBDEV - Browser code The name of the List Box (or Combo Box) control to use must be specified.
<Element index>: Optional integer
Index of the element to delete from the List Box or Combo Box control. If this parameter is not specified:
  • in a single-selection List Box control, the current element is deleted.
  • in a multi-selection List Box control, the selected elements are deleted.
  • in a Combo Box control, the current element is deleted. If this control is an editable Combo Box control, the edit control is cleared.
WEBDEV - Server codeWEBDEV - Browser code The editable Combo Box controls are not available.

Cascading deletions

When deleting a set of elements, the elements found after each deleted element are moved. To perform cascading deletions, we advise you to start from the last element.
For example:
Index is int
FOR Index = ListCount(LIST_CustomerList) TO 1 STEP -1
ListDelete(LIST_CustomerList, Index)
WEBDEV - Browser code

Deleting an element on the browser

When deleting an element in browser code, this element is only deleted from the page displayed in the browser. In order for this element to be deleted from the server, ListDelete must be run on the server.
Calling ListDelete in browser code is useful when using AJAX technology, in "Programmed AJAX" mode (via AJAXExecute or AJAXExecuteAsynchronous).
Reminder: In "Automatic and immediate AJAX" mode, all you have to do is switch the server process containing ListDelete to automatic AJAX mode. That's it! No additional programming is required. For more details, see AJAX.


  • To delete an element from a Table control, use TableDelete.
  • ListDelete can be used on a "Combo Box" table column.
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Exemplo ListDelete

//Exclui um elemento

//Exclui todos elemento

//Blog com Video e Exemplo
28 May 2016

Last update: 06/07/2022

Send a report | Local help