LastClickedItem Property

Returns the last ListItem clicked. Read-only, runtime property.

ListViewObject.LastClickedItem = [object]

Where ListViewObject evaluates to a list view control on the active form, and object is the ListItem object that was last clicked by the user.

Client support

   Newlook Smartclient only.

Version Support

Introduced in Version 11.0.

Use

This property replaces the deprecated LastItemClicked property. LastItemClicked returned the Index of the item clicked by the user, whereas LastClickedItem returns the entire ListItem object.

This property is useful if you wish to return a property of the last item clicked by the user, for instance its Text value.

NOTE:

This property returns the last ListViewItem object clicked (not the sub-item). Clicking on a sub-item will set this property to the ListItem that corresponds to that row within the ListView.

EXAMPLE

The following JScript runs on the OnItemClick event of the lvItems list view control, and returns the ListItem clicked by the user. It then sets a label on the form with the Text value of the clicked item.

J SCRIPT

function OnItemClick()

{

var listView = App.ActiveForm.lvItems;

var itemText = "";

if (null != listView.LastClickedItem)

  itemText = listView.LastClickedItem.Text;

 

//Set the label caption to the text of the clicked item.

App.ActiveForm.lbItemText.Caption = itemText;

}

See Also

OnItemClick property | LastClickedColumn property | EnsureVisible method

Applies To

ListView control


© 2004-2021 looksoftware. All rights reserved.