Your search did not match any results.

List - Grouped List

The List component can display items as a two-level hierarchy: parent and child items. To group items, set the grouped property to true and ensure the data source defines the hierarchy in one of the following ways.

Backend API
<div class="list-container"> @(Html.DevExtreme().List() .Height("100%") .Grouped(true) .CollapsibleGroups(true) .GroupTemplate(@<text> <div>Assigned: <%- key %></div> </text>) .DataSource(Model) ) </div>
using DevExtreme.MVC.Demos.Models.SampleData; using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class ListController : Controller { public ActionResult GroupedList() { return View(SampleData.ListGroupedData); } } }
using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.MVC.Demos.Models.SampleData { public partial class SampleData { public static object[] ListGroupedData = new[] { new { key = "Mr. John Heart", items = new[] { "Choose between PPO and HMO Health Plan", "Google AdWords Strategy", "New Brochures", "Update NDA Agreement", "Review Product Recall Report by Engineering Team" } }, new { key = "Mrs. Olivia Peyton", items = new[] { "Update Personnel Files", "Review Health Insurance Options Under the Affordable Care Act", "Non-Compete Agreements" } }, new { key = "Mr. Robert Reagan", items = new[] { "Deliver R&D Plans for 2013", "Decide on Mobile Devices to Use in the Field", "Try New Touch-Enabled WinForms Apps", "Approval on Converting to New HDMI Specification" } }, new { key = "Ms. Greta Sims", items = new[] { "Approve Hiring of John Jeffers", "Update Employee Files with New NDA", "Give Final Approval for Refunds" } }, new { key = "Mr. Brett Wade", items = new[] { "Prepare 3013 Marketing Plan", "Rollout of New Website and Marketing Brochures", "Review 2012 Sales Report and Approve 2013 Plans", "Review Site Up-Time Report" } }, new { key = "Mrs. Sandra Johnson", items = new[] { "Provide New Health Insurance Docs", "Review HR Budget Company Wide", "Final Budget Review" } }, new { key = "Mr. Kevin Carter", items = new[] { "Sign Updated NDA", "Review Overtime Report", "Upgrade Server Hardware", "Upgrade Personal Computers" } }, new { key = "Ms. Cynthia Stanwick", items = new[] { "Prepare 2013 Financial", "Update Revenue Projections", "Submit D&B Number to ISP for Credit Approval" } }, new { key = "Dr. Kent Samuelson", items = new[] { "Update Sales Strategy Documents", "Review Revenue Projections", "Refund Request Template" } } }; } }
.list-container { min-height: 440px; width: 100%; height: auto; position: absolute; top: 0; bottom: 0; }

Hierarchical Data Source Structure

You can use a dataSource where each entry is an object that contains the key and items fields. The key field specifies the group header (parent), and the items field holds an array of child items. This demo shows how to use this type of data source.

A data source can specify different field names if the data is structured in the same way. In this case, implement the DataSource's map function to create key and items field mappings. Refer to the following help topic for more information: Item Mapping.

Grouping Field

The data source can contain a plain list of objects with multiple fields. Assign a field to the DataSource's group property to create a hierarchical display. Parent items display unique values from the specified field, and Child items display grouped values.

Group Display Settings

If you need to make the groups collapsible, set the collapsibleGroups to true.

You can also use the groupTemplate property to customize the appearance of group headers.