Clear Method - ListItems

This method clears all the list items in the ListView control.

ListView object.Clear()

Client support

   Newlook Smartclient only.

Parameters

None.

Returns

Returns a Boolean indicating the success or failure of the action.

Use

It is worth noting that the View property of a ListView control must be set to Report, to render columns in the ListView control. Calling this method will only remove the list items but not the columns. If you wish to remove all list items and columns, use the Clear method with the Column Headers collection instead.

Examples

The following example removes all list items from a ListView control :

JSCRIPT

function ClearListView()

{

//Clear existing list items from the list view control

var clearSuccess = App.ActiveForm.lvTest.ListItems.Clear();

 

//Refresh list

App.RefreshForm();

}

Use the RefreshForm method to update the contents of the control after this method has been invoked if necessary.

See Also

Add Method - ColumnHeaders | Remove Method - ListView Column Headers

Applies To

ListView Items collection


© 2004-2021 looksoftware. All rights reserved.