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:
property int GroupItemCount {
	virtual int get();
	virtual void set(int value);
}

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.

Exception Condition
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
Available since 3.5
Return to top
Show: