Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

ListView.GroupSeparatorTemplate Property

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 a null reference (Nothing in Visual Basic), 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

Supported in: 4.6, 4.5, 4, 3.5
© 2015 Microsoft