ListView.GroupSeparatorTemplate Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the user-defined content for the separator between groups in a ListView control.

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

abstract GroupSeparatorTemplate : ITemplate with get, set
override GroupSeparatorTemplate : ITemplate with get, set

Property Value

Type: System.Web.UI.ITemplate

An object that contains the custom content for the group separator. The default is null, which indicates that this property is not set.

The separator enables you to put an element that has custom content between each group. The ListView control then alternately renders the GroupTemplate content and the GroupSeparatorTemplate content. The GroupTemplate content is always rendered last.

Make sure that you define the content for the whole row in the GroupSeparatorTemplate template, because the ListView control renders the GroupSeparatorTemplate content inside the LayoutTemplate template. For example, the groups in the ListView control might be created by using a table row (tr) element. If the GroupItemCount property is set to 3, the colspan attribute must be set to 3 in the GroupSeparatorTemplate template.

To specify a template declaratively for the separator, add a GroupSeparatorTemplate element inside the ListView control. You can then add the contents of the template to the GroupSeparatorTemplate element.

The following example shows how to create a group separator in the ListView control by using the GroupSeparatorTemplate property.

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

.NET Framework
Available since 3.5
Return to top