ListView.groupDataSource property

0 out of 1 rated this helpful - Rate this topic

Gets or sets the data source that contains the groups for the items in the itemDataSource.

Syntax


<div data-win-control="WinJS.UI.ListView" 
  data-win-options="{ groupDataSource : value}" >
</div>


var groupDataSource = listView.groupDataSource;
listView.groupDataSource = groupDataSource;

Property value

Type: IListDataSource

The data source that contains the groups for the items in the itemDataSource.

Remarks

To display group information, such as group headers and group boundaries, your ListView control's layout must be set to a GridLayout. For grouping to work at all, the ListView control's loadingBehavior property must be set to "randomaccess" (which is the default value).

There are two ways to obtain a suitable group data source:

  • Use the computeDataSourceGroups function to create an IListDataSource that contains group information. Set the groupDataSource property to the value returned by the IListDataSource object's groups property.
  • Use the List.createGrouped method to create a List that contains group information. Set the groupDataSource property to the value returned by the List object's groups.dataSource property.

For more info, see How to group items in a ListView.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Namespace

WinJS.UI

Library

Ui.js

See also

ListView
How to group items in a ListView

 

 

Build date: 12/5/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.