Share via


Using the ListView control

The ListView control displays data in a customizable list or grid.

The ListView control has the following options, visible in the HTML Attributes panel:

  • automaticallyLoadPages   Indicates whether the next set of pages is automatically loaded when the user scrolls beyond the number of pages specified by the pagesToLoadThreshold property.

  • groupDataSource   Sets the data source that contains the groups for the items in the itemDataSource.

  • groupHeaderTemplate   Sets the Template or function that creates the DOM elements for each group header in the groupDataSource. Each group header can contain multiple elements, but it must have a single root element.

    For more information about Template, see Template on MSDN.

  • itemDataSource   Sets the data source that provides the ListView with items.

  • itemTemplate   Sets the Template or function that creates the DOM elements for each item in the itemDataSource. Each item can contain multiple elements, but it must have a single root element.

    For more information about Template, see Template on MSDN.

  • layout   Sets an object that controls the layout of the ListView.

  • loadingBehavior   Sets a value that specifies how many items are loaded into the DOM.

  • scrollPosition   Sets the distance, in pixels, between the first item in the list and the current viewable area.

  • selectionMode   Sets the selection mode of the ListView.

  • swipeBehavior   Sets how the ListView reacts to the swipe gesture. The swipe gesture can select the swiped items or can have no effect on the current selection.

  • tapBehavior   Sets how the ListView reacts when the user taps or clicks an item.

  • currentItem   Determines the layout of the AppBar contents.

  • indexOfFirstVisible   Sets the first visible item.

  • indexOfLastVisible   Sets the last visible item in the ListView.

  • pagesToLoad   Sets the number of pages to load when the user scrolls beyond the threshold the pagesToLoadThreshold property specifies if the loadingBehavior property is set to incremental.

  • pagesToLoadThreshold   Sets the threshold (in pages) for initiating an incremental load. When the last visible item is within the specified number of pages from the end of the loaded portion of the list, and if automaticallyLoadPages is true and loadingBehavior is set to incremental, the ListView initiates an incremental load.

  • resetGroupHeader   Determines the layout of the AppBar contents.

  • restItem   Determines the location of the AppBar object.

  • selection   Sets the AppBarCommand objects that appear in the app bar.

  • zoomableView   Gets a ZoomableView that supports semantic zoom functionality. This API supports the SemanticZoom infrastructure and is not intended to be used directly from your code.

For more information about the ListView control, see WinJS.UI.ListView object on MSDN.