This documentation is archived and is not being maintained.

ListView::GroupItemCount Property

Gets or sets the number of items to display per group in a ListView control.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public:
virtual property int GroupItemCount {
	int get ();
	void set (int value);
}
<asp:ListView GroupItemCount="Int32" />

Property Value

Type: System::Int32
The number of items to display per group in a ListView control. The default is 1, which indicates that the ListView control will display one item per group.

ExceptionCondition
ArgumentOutOfRangeException

The GroupItemCount property is set to a value less than 1.

Use the GroupItemCount property to specify the number of items to be grouped together in the ListView control. (In other words, this specifies the number of items to display for each group of the control.) For each group, the ListView control renders the contents of the GroupTemplate template and replaces the item placeholder with the actual item content. It does this as many times as the number of items defined by the GroupItemCount property.

You can use GroupItemCount with the GroupTemplate template to create a tiled layout in the ListView control. In a tiled table layout, the items are repeated horizontally in a row. The numbers of times that an item is repeated is specified by the GroupItemCount property.

The following example shows how to create a tiled layout in the ListView control by using the GroupItemCount property. It also shows how to change this property programmatically.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: