This documentation is archived and is not being maintained.

ListView.GroupPlaceholderID Property

Gets or sets the ID for the group placeholder in a ListView control.

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

public virtual string GroupPlaceholderID { get; set; }
<asp:ListView GroupPlaceholderID="String" />

Property Value

Type: System.String
The ID for the group placeholder in a ListView control. The default is "groupPlaceholder".


The specified ID is null or an empty string.

Use the GroupPlaceholderID property to specify an ID for the group placeholder. The group placeholder is the control that you add to the LayoutTemplate template when you are using groups to represent where the group will be rendered.

The following example shows how to use the GroupPlaceholderID property to specify a different ID for the group placeholder of the ListView control.

<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="" >
  <head id="Head1" runat="server">
    <title>ListView GroupContainerID and ItemContainerID Example</title>
    <style type="text/css">
      	  font: 10pt Trebuchet MS, Arial, Tahoma; 
      	  text-align: center;
      th { background: #b7cfff; }
          border: 1px dashed #a4cbf4;
          background: white;
          min-height: 19px;
          width: 33%;
        border: solid 1px #a4cbf4;
        background: #edf5fd;
        width: 33%;
        min-height: 19px;
    <form id="form1" runat="server">

      <h3>ListView GroupContainerID and ItemContainerID Example</h3>

      <asp:ListView ID="ContactsListView" 
          <table cellpadding="4" width="640px" runat="server" id="tblContacts">
            <tr runat="server">
              <th colspan="3" runat="server">Contacts</th>
            <tr runat="server" id="ContactRowContainer" />
          <asp:DataPager ID="ContactsDataPager" runat="server" PageSize="30">
              <asp:NumericPagerField ButtonCount="10" />
          <tr runat="server" id="ContactRow">
            <td runat="server" id="ContactItemContainer" />
          <td class="item" runat="server">
            <asp:Label ID="NameLabel" runat="server" 
              Text='<%# Eval("LastName") + ", " + Eval("FirstName")%>' />
          <td class="alternatingItem" runat="server">
            <asp:Label ID="NameLabel" runat="server" 
              Text='<%# Eval("LastName") + ", " + Eval("FirstName")%>' />

      <!-- This example uses Microsoft SQL Server and connects      -->
      <!-- to the AdventureWorks sample database. Use an ASP.NET    -->
      <!-- expression to retrieve the connection string value       -->
      <!-- from the Web.config file.                                -->      
      <asp:SqlDataSource ID="ContactsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
        SelectCommand="SELECT [FirstName], [LastName] 
          FROM Person.Contact ORDER BY [LastName], [FirstName] ">


.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.