$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
ListView Grouping Feature in ASP.NET
Home > How to > ListView Grouping

In the previous user manuals, we have presented you with some of the basic features and functions of this Kettic ListView control for ASP.NET AJAX UI. In this guide, we will explore the topic of item grouping with your listview.
This tutorial is mainly made up of two sections. In the first section, we will first get to know the three basic properties for item grouping in listview, which are GroupItemCount, GroupPlaceHolderID, and then ItemPlaceHolderID. While in the second section, we will introduce to you several templates which are related to item grouping. Corresponding aspx sample codes will also be provided so you can find it quite easy to copy to your project for a test.
Apart from this guide, users can also get from help for other listview related customization. We have listed a few tutorials here for your reference.
  • How to perform listview item paging in ASP.NET AJAX UI project
  • How to perform listview item sorting in ASP.NET AJAX UI project
  • How to perform listview item selecting in ASP.NET AJAX UI project
  • How to perform listview item filtering in ASP.NET AJAX UI project
  • How to perform listview data binding in ASP.NET AJAX UI project

ListView Item Grouping Properties

In this section, we will introduce to you three commonly used properties for Kettic ListView setting so you can easily conduct item grouping easily. And they are explained briefly in the list below:
  • GroupItemCount: In general, this property is used to define the number of items in each group which you have specified;
  • GroupPlaceHolderID: Web developer can set this listview property to specify the ID for the group place holder;
  • ItemPlaceHolderID: If you want to set the ID for your item place holder, you can simply try setting this property.
Presented below is a simple aspx code snippet which we have prepared for your reference. You can see that we have all the three properties mentioned above. Please make any amendment according your requirements.
<kettic:PerListView ID="PerListView2" DataSourceID="SqlDataSource2" runat="server"
ItemPlaceholderID="EmployeesContainer" GroupPlaceholderID="GroupsEmployeesContainer"
GroupItemCount="3">
</kettic:PerListView>

ListView Templates for Item Grouping

In this section, we will help you get to know four templates that are of importance for Kettic ListView control item grouping. Details are provided in the paragraphs below.
LayoutTemplate: As you can tell from the name, this template is generally used to define how you want the groups to display in your listview. Here are the aspx sample codes.
<LayoutTemplate>
<fieldset>
<legend>Products</legend>
<asp:PlaceHolder ID="GroupsEmployeesContainer" runat="server"></asp:PlaceHolder>
</fieldset>
</LayoutTemplate>
GroupTemplate: This template is designed to help you build your group structure and then control the look of it.
<GroupTemplate>
<fieldset>
<legend>Products group</legend>
<asp:PlaceHolder ID="EmployeesContainer" runat="server"></asp:PlaceHolder>
</fieldset>
</GroupTemplate>
GroupSeparatorTemplate: If you have quite a number of groups, you might need to group separator to better identify each group. Using this template, you can easily customize the separator so it is easier to recognize each group.
<GroupSeparatorTemplate>
<div style="clear: both">
</div>
<hr/>
</GroupSeparatorTemplate>
ASP.NET AJAX UI Controls