Example of Hierarchy and Detail Template in ASP.NET MVC Data Grid Control
This sample demonstrates the Grid component's detail template feature. It lets user click the expand button in each Grid row to displays detailed information about that row.
@Html.UiGrid(new UiGridOptions
{
Id = "DetailTemplate",
Data = ViewData["dataSource"],
Height = "600px",
DetailTemplate = "#detailtemplate",
OnDetailDataBound = "detailDataBound",
OnQueryCellInfo = "queryCellInfo",
AllowSorting = true,
AllowFiltering = true,
FilterType = UiGridFilterType.CheckBox,
Columns = new List<UiGridColumn>
{
new UiGridColumn { HeaderText = "Image", Width = 110, TextAlign = UiTextAlign.Center, Template = "#imageCell" },
new UiGridColumn { Field = "EmployeeID", HeaderText = "ID", Width = 110, TextAlign = UiTextAlign.Right, IsPrimaryKey = true },
new UiGridColumn { Field = "Name", HeaderText = "Name", Width = 110 },
new UiGridColumn { Field = "MailID", HeaderText = "Email ID", Width = 110, Template = "#mailIDTemplate" },
new UiGridColumn { Field = "SoftwareTeam", HeaderText = "Team(s)", Width = 150 },
new UiGridColumn { Field = "ReportTo", HeaderText = "Reporter", Width = 110 }
}
})
<style>
.image { display: inline-flex; align-items: center; justify-content: center; width: 55px; height: 55px; border-radius: 50px; color: #fff; font-weight: 600; box-shadow: inset 0 0 1px #e0e0e0, inset 0 0 14px rgba(68, 66, 66, 0.2); }
.hg-detail { padding: 8px 12px; }
.hg-tabs { display: flex; gap: 4px; border-bottom: 1px solid #ddd; margin-bottom: 8px; }
.hg-tabs button { border: 0; background: none; padding: 6px 14px; cursor: pointer; border-bottom: 2px solid transparent; font: inherit; }
.hg-tabs button[aria-selected="true"] { border-bottom-color: #5c6bc0; font-weight: 600; }
.hg-board { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; }
.hg-column { background: #f5f5f7; border-radius: 6px; padding: 6px; min-height: 80px; }
.hg-column h5 { margin: 2px 4px 6px; font-size: 13px; }
.hg-card { background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; font-size: 12px; }
.hg-card b { display: block; }
.hg-chart { max-width: 560px; }
</style>
<template id="mailIDTemplate"><a href="mailto:${MailID}">${MailID}</a></template>
<template id="imageCell"><span></span></template>
<template id="detailtemplate"><div class="hg-detail"></div></template>
@Html.UiGrid(new UiGridOptions
{
Id = "DetailTemplate",
Data = ViewData["dataSource"],
Height = "600px",
DetailTemplate = "#detailtemplate",
OnDetailDataBound = "detailDataBound",
OnQueryCellInfo = "queryCellInfo",
AllowSorting = true,
AllowFiltering = true,
FilterType = UiGridFilterType.CheckBox,
Columns = new List<UiGridColumn>
{
new UiGridColumn { HeaderText = "Image", Width = 110, TextAlign = UiTextAlign.Center, Template = "#imageCell" },
new UiGridColumn { Field = "EmployeeID", HeaderText = "ID", Width = 110, TextAlign = UiTextAlign.Right, IsPrimaryKey = true },
new UiGridColumn { Field = "Name", HeaderText = "Name", Width = 110 },
new UiGridColumn { Field = "MailID", HeaderText = "Email ID", Width = 110, Template = "#mailIDTemplate" },
new UiGridColumn { Field = "SoftwareTeam", HeaderText = "Team(s)", Width = 150 },
new UiGridColumn { Field = "ReportTo", HeaderText = "Reporter", Width = 110 }
}
})
<script>
var taskData = @Html.Raw(UiJson.Serialize(ViewData["taskData"]));
function queryCellInfo(args) {
if (args.column === null && args.headerText === 'Image') {
var circle = document.createElement('div');
circle.className = 'image';
circle.style.background = 'hsl(' + (parseInt(String(args.data.EmployeeID).replace(/\D/g, ''), 10) * 47 % 360) + ', 45%, 45%)';
circle.setAttribute('role', 'img');
circle.setAttribute('aria-label', args.data.Name);
circle.textContent = String(args.data.Name || '').split(' ').map(function (p) { return p.charAt(0); }).join('').slice(0, 2).toUpperCase();
args.content = circle;
}
}
// Syncfusion's detail row: a Tab with the employee's tasks as a Kanban board and a burndown line chart; here both are drawn with the page's own markup.
function generateData(tasks) {
return ['Open', 'InProgress', 'Testing', 'Close'].map(function (status) {
var some = tasks.filter(function (t) { return t.Status === status; });
return {
status: status,
estimated: some.reduce(function (s, t) { return s + t.Estimate; }, 0),
spent: some.reduce(function (s, t) { return s + t.Spent; }, 0),
taskid: some.length ? some[0].Id : ''
};
});
}
function element(tag, className, text) {
var el = document.createElement(tag);
if (className) { el.className = className; }
if (text !== undefined) { el.textContent = text; }
return el;
}
function burndown(points) {
var ns = 'http://www.w3.org/2000/svg', w = 520, h = 260, left = 40, bottom = 40, top = 20;
var svg = document.createElementNS(ns, 'svg');
svg.setAttribute('viewBox', '0 0 ' + w + ' ' + h);
svg.setAttribute('class', 'hg-chart');
svg.setAttribute('role', 'img');
svg.setAttribute('aria-label', 'Burndown chart: estimated and spent hours by status');
var max = Math.max(1, Math.max.apply(null, points.map(function (p) { return Math.max(p.estimated, p.spent); })));
function x(i) { return left + (w - left - 20) * (i / (points.length - 1)); }
function y(v) { return top + (h - top - bottom) * (1 - v / max); }
function add(tag, attrs, text) {
var el = document.createElementNS(ns, tag);
Object.keys(attrs).forEach(function (k) { el.setAttribute(k, attrs[k]); });
if (text !== undefined) { el.textContent = text; }
svg.appendChild(el);
}
add('line', { x1: left, y1: h - bottom, x2: w - 20, y2: h - bottom, stroke: '#999' });
add('line', { x1: left, y1: top, x2: left, y2: h - bottom, stroke: '#999' });
points.forEach(function (p, i) { add('text', { x: x(i), y: h - bottom + 16, 'text-anchor': 'middle', 'font-size': 11 }, p.taskid || p.status); });
[['estimated', '#5c6bc0', 'Estimated Hours'], ['spent', '#ef6c00', 'Spent Hours']].forEach(function (series, s) {
add('polyline', { points: points.map(function (p, i) { return x(i) + ',' + y(p[series[0]]); }).join(' '), fill: 'none', stroke: series[1], 'stroke-width': 2 });
points.forEach(function (p, i) { add('circle', { cx: x(i), cy: y(p[series[0]]), r: 4, fill: series[1] }); });
add('rect', { x: left + s * 150, y: 2, width: 10, height: 10, fill: series[1] });
add('text', { x: left + s * 150 + 14, y: 11, 'font-size': 11 }, series[2]);
});
add('text', { x: 8, y: top + 8, 'font-size': 11 }, max + 'h');
return svg;
}
function detailDataBound(args) {
var box = args.detailElement.querySelector('.hg-detail') || args.detailElement;
var tasks = taskData.filter(function (t) { return t.Assignee === args.data.Name; });
var tabs = element('div', 'hg-tabs');
tabs.setAttribute('role', 'tablist');
var board = element('div', 'hg-board');
var chart = element('div', '');
chart.hidden = true;
[['Open', 'Open'], ['In Progress', 'InProgress'], ['Testing', 'Testing'], ['Done', 'Close']].forEach(function (col) {
var column = element('div', 'hg-column');
column.appendChild(element('h5', '', col[0]));
tasks.filter(function (t) { return t.Status === col[1]; }).forEach(function (t) {
var card = element('div', 'hg-card');
card.appendChild(element('b', '', t.Id));
card.appendChild(element('span', '', t.Summary));
card.appendChild(element('span', '', 'Estimated hour: ' + t.Estimate));
column.appendChild(card);
});
board.appendChild(column);
});
chart.appendChild(element('h5', '', 'Burndown Chart'));
chart.appendChild(burndown(generateData(tasks)));
[['Tasks', board], ['Burndown Chart', chart]].forEach(function (tab, i) {
var b = element('button', '', tab[0]);
b.type = 'button';
b.setAttribute('role', 'tab');
b.setAttribute('aria-selected', i === 0 ? 'true' : 'false');
b.addEventListener('click', function () {
Array.prototype.forEach.call(tabs.children, function (x) { x.setAttribute('aria-selected', x === b ? 'true' : 'false'); });
board.hidden = tab[1] !== board;
chart.hidden = tab[1] !== chart;
});
tabs.appendChild(b);
});
box.appendChild(tabs);
box.appendChild(board);
box.appendChild(chart);
}
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class GridController : Controller
{
// The page is Views/Grid/HierarchyGrid.cshtml; it draws what ViewData holds.
public ActionResult HierarchyGrid()
{
var DataSource = EmployeeDetails.GetAllRecords();
ViewData["dataSource"] = DataSource;
var taskDetail = TaskDetail.GetAllRecords();
ViewData["taskData"] = taskDetail;
return View();
}
public class Customer
{
public Customer(){}
public Customer(string CustomerID, string ContactName, string CompanyName, string Address, string Country) {
this.CustomerID = CustomerID;
this.CompanyName = CompanyName;
this.ContactName = ContactName;
this.Address = Address;
this.Country = Country;
}
public static List<Customer> GetAllRecords()
{
List<Customer> cust = new List<Customer>();
cust.Add(new Customer("ALFKI", "Maria", "Alfreds Futterkiste", "Obere Str. 57", "Germany"));
cust.Add(new Customer("ANATR", "Ana Trujillo", "Ana Trujillo Emparedados y helados", "Avda. de la Constitución 2222", "Mexico"));
cust.Add(new Customer("BLONP", "Frédérique Citeaux", "Blondesddsl père et fils", "24, place Kléber", "France"));
cust.Add(new Customer("BOLID", "Martín Sommer", "Bólido Comidas preparadas", "C/ Araquil, 67", "Spain"));
cust.Add(new Customer("ANTON", "Elizabeth Lincoln", "Bottom-Dollar Markets", "23 Tsawassen Blvd.", "Canada"));
//cust.Add(new Customer("BONAP", "Laurence Lebihan", "Bon app", "12, rue des Bouchers", "France"));
//cust.Add(new Customer("BSBEV", "Victoria Ashworth", "B's Beverages", "Fauntleroy Circus", "UK"));
//cust.Add(new Customer("CACTU", "Patricio Simpson", "Cactus Comidas para llevar", "Cerrito 333", "Argentina"));
//cust.Add(new Customer("CENTC", "Francisco Chang", "Centro comercial Moctezuma", "Sierras de Granada 9993", "Mexico"));
//cust.Add(new Customer("CHOPS", "Yang Wang", "Chop-suey Chinese", "Hauptstr. 29", "Switzerland"));
//cust.Add(new Customer("COMMI", "Pedro Afonso", "Comércio Mineiro", "Av. dos Lusíadas, 23", "Brazil"));
//cust.Add(new Customer("CONSH", "Elizabeth Brown", "Consolidated Holdings", "Berkeley Gardens 12 Brewery", "UK"));
//cust.Add(new Customer("DRACD", "Sven Ottlieb", "Drachenblut Delikatessen", "Walserweg 21", "Germany"));
//cust.Add(new Customer("DUMON", "Janine Labrune", "Du monde entier", "67, rue des Cinquante Otages", "France"));
//cust.Add(new Customer("EASTC", "Ann Devon", "Eastern Connection", "35 King George", "UK"));
//cust.Add(new Customer("ERNSH", "Roland Mendel", "Ernst Handel", "Kirchgasse 6", "Austria"));
//cust.Add(new Customer("FAMIA", "Aria Cruz", "Familia Arquibaldo", "Rua Orós, 92", "Brazil"));
//cust.Add(new Customer("FISSA", "Diego Roel", "FISSA Fabrica Inter. Salchichas S.A.", "C/ Moralzarzal, 86", "Spain"));
//cust.Add(new Customer("FOLIG", "Martine Rancé", "Folies gourmandes", "184, chaussée de Tournai", "France"));
//cust.Add(new Customer("FOLKO", "Maria Larsson", "Folk och fä HB", "Åkergatan 24", "Sweden"));
//cust.Add(new Customer("FRANK", "Peter Franken", "Frankenversand", "Berliner Platz 43", "Germany"));
//cust.Add(new Customer("FRANR", "Carine Schmitt", "France restauration", "54, rue Royale", "France"));
//cust.Add(new Customer("FRANS", "Paolo Accorti", "Franchi S.p.A.", "Via Monte Bianco 34", "Italy"));
//cust.Add(new Customer("FURIB", "Lino Rodriguez", "Furia Bacalhau e Frutos do Mar", "Jardim das rosas n. 32", "Portugal"));
//cust.Add(new Customer("GALED", "Eduardo Saavedra", "Galería del gastrónomo", "Rambla de Cataluña, 23", "Spain"));
//cust.Add(new Customer("GODOS", "José Pedro Freyre", "Godos Cocina Típica", "C/ Romero, 33", "Spain"));
//cust.Add(new Customer("GOURL", "André Fonseca", "Gourmet Lanchonetes", "Av. Brasil, 442", "Brazil"));
//cust.Add(new Customer("GREAL", "Howard Snyder", "Great Lakes Food Market", "2732 Baker Blvd.", "USA"));
//cust.Add(new Customer("GROSR", "Manuel Pereira", "GROSELLA-Restaurante", "5ª Ave. Los Palos Grandes", "Venezuela"));
//cust.Add(new Customer("HANAR", "Mario Pontes", "Hanari Carnes", "Rua do Paço, 67", "Brazil"));
//cust.Add(new Customer("HILAA", "Carlos Hernández", "HILARION-Abastos", "Carrera 22 con Ave. Carlos Soublette #8-35", "Venezuela"));
//cust.Add(new Customer("HUNGC", "Yoshi Latimer", "Hungry Coyote Import Store", "City Center Plaza 516 Main St.", "USA"));
//cust.Add(new Customer("HUNGO", "Patricia McKenna", "Hungry Owl All-Night Grocers", "8 Johnstown Road", "Ireland"));
//cust.Add(new Customer("ISLAT", "Helen Bennett", "Island Trading", "Garden House Crowther Way", "UK"));
//cust.Add(new Customer("KOENE", "Philip Cramer", "Königlich Essen", "Maubelstr. 90", "Germany"));
//cust.Add(new Customer("LACOR", "Daniel Tonini", "La corne d'abondance", "67, avenue de l'Europe", "France"));
//cust.Add(new Customer("LAMAI", "Annette Roulet", "La maison d'Asie", "1 rue Alsace-Lorraine", "France"));
//cust.Add(new Customer("LAUGB", "Yoshi Tannamuri", "Laughing Bacchus Wine Cellars", "1900 Oak St.", "Canada"));
//cust.Add(new Customer("LAZYK", "John Steel", "Lazy K Kountry Store", "12 Orchestra Terrace", "USA"));
//cust.Add(new Customer("LEHMS", "Renate Messner", "Lehmanns Marktstand", "Magazinweg 7", "Germany"));
//cust.Add(new Customer("LETSS", "Jaime Yorres", "Let's Stop N Shop", "87 Polk St. Suite 5", "USA"));
//cust.Add(new Customer("LILAS", "Carlos González", "LILA-Supermercado", "Carrera 52 con Ave. Bolívar #65-98 Llano Largo", "Venezuela"));
//cust.Add(new Customer("LINOD", "Felipe Izquierdo", "LINO-Delicateses", "Ave. 5 de Mayo Porlamar", "Venezuela"));
//cust.Add(new Customer("LONEP", "Fran Wilson", "Lonesome Pine Restaurant", "89 Chiaroscuro Rd.", "USA"));
//cust.Add(new Customer("MAGAA", "Giovanni Rovelli", "Magazzini Alimentari Riuniti", "Via Ludovico il Moro 22", "Italy"));
//cust.Add(new Customer("MAISD", "Catherine Dewey", "Maison Dewey", "Rue Joseph-Bens 532", "Belgium"));
//cust.Add(new Customer("MEREP", "Jean Fresnière", "Mère Paillarde", "43 rue St. Laurent", "Canada"));
//cust.Add(new Customer("MORGK", "Alexander Feuer", "Morgenstern Gesundkost", "Heerstr. 22", "Germany"));
//cust.Add(new Customer("NORTS", "Simon Crowther", "North/South", "South House 300 Queensbridge", "UK"));
//cust.Add(new Customer("OCEAN", "Yvonne Moncada", "Océano Atlántico Ltda.", "Ing. Gustavo Moncada 8585 Piso 20-A", "Argentina"));
//cust.Add(new Customer("OLDWO", "Rene Phillips", "Old World Delicatessen", "2743 Bering St.", "USA"));
//cust.Add(new Customer("OTTIK", "Henriette Pfalzheim", "Ottilies Käseladen", "Mehrheimerstr. 369", "Germany"));
//cust.Add(new Customer("PARIS", "Marie Bertrand", "Paris spécialités", "265, boulevard Charonne", "France"));
//cust.Add(new Customer("PERIC", "Guillermo Fernández", "Pericles Comidas clásicas", "Calle Dr. Jorge Cash 321", "Mexico"));
//cust.Add(new Customer("PICCO", "Georg Pipps", "Piccolo und mehr", "Geislweg 14", "Austria"));
//cust.Add(new Customer("PRINI", "Isabel de Castro", "Princesa Isabel Vinhos", "Estrada da saúde n. 58", "Portugal"));
//cust.Add(new Customer("QUEDE", "Bernardo Batista", "Que Delícia", "Rua da Panificadora, 12", "Brazil"));
//cust.Add(new Customer("QUEEN", "Lúcia Carvalho", "Queen Cozinha", "Alameda dos Canàrios, 891", "Brazil"));
//cust.Add(new Customer("QUICK", "Horst Kloss", "QUICK-Stop", "Taucherstraße 10", "Germany"));
//cust.Add(new Customer("RANCH", "Sergio Gutiérrez", "Rancho grande", "Av. del Libertador 900", "Argentina"));
//cust.Add(new Customer("RATTC", "Paula Wilson", "Rattlesnake Canyon Grocery", "2817 Milton Dr.", "USA"));
//cust.Add(new Customer("REGGC", "Maurizio Moroni", "Reggiani Caseifici", "Strada Provinciale 124", "Italy"));
//cust.Add(new Customer("RICAR", "Janete Limeira", "Ricardo Adocicados", "Av. Copacabana, 267", "Brazil"));
//cust.Add(new Customer("RICSU", "Michael Holz", "Richter Supermarkt", "Grenzacherweg 237", "Switzerland"));
//cust.Add(new Customer("ROMEY", "Alejandra Camino", "Romero y tomillo", "Gran Vía, 1", "Spain"));
//cust.Add(new Customer("SANTG", "Jonas Bergulfsen", "Santé Gourmet", "Erling Skakkes gate 78", "Norway"));
//cust.Add(new Customer("SAVEA", "Jose Pavarotti", "Save-a-lot Markets", "187 Suffolk Ln.", "USA"));
//cust.Add(new Customer("SEVES", "Hari Kumar", "Seven Seas Imports", "90 Wadhurst Rd.", "UK"));
//cust.Add(new Customer("SIMOB", "Jytte Petersen", "Simons bistro", "Vinbæltet 34", "Denmark"));
//cust.Add(new Customer("SPECD", "Dominique Perrier", "Spécialités du monde", "25, rue Lauriston", "France"));
//cust.Add(new Customer("SPLIR", "Art Braunschweiger", "Split Rail Beer & Ale", "P.O. Box 555", "USA"));
//cust.Add(new Customer("SUPRD", "Pascale Cartrain", "Suprêmes délices", "Boulevard Tirou, 255", "Belgium"));
//cust.Add(new Customer("THEBI", "Liz Nixon", "The Big Cheese", "89 Jefferson Way Suite 2", "USA"));
//cust.Add(new Customer("THECR", "Liu Wong", "The Cracker Box", "55 Grizzly Peak Rd.", "USA"));
//cust.Add(new Customer("TOMSP", "Karin Josephs", "Toms Spezialitäten", "Luisenstr. 48", "Germany"));
//cust.Add(new Customer("TORTU", "Miguel Angel Paolino", "Tortuga Restaurante", "Avda. Azteca 123", "Mexico"));
//cust.Add(new Customer("TRADH", "Anabela Domingues", "Tradição Hipermercados", "Av. Inês de Castro, 414", "Brazil"));
//cust.Add(new Customer("TRAIH", "Helvetius Nagy", "Trail's Head Gourmet Provisioners", "722 DaVinci Blvd.", "USA"));
//cust.Add(new Customer("VAFFE", "Palle Ibsen", "Vaffeljernet", "Smagsloget 45", "Denmark"));
//cust.Add(new Customer("VICTE", "Mary Saveley", "Victuailles en stock", "2, rue du Commerce", "France"));
//cust.Add(new Customer("VINET", "Paul Henriot", "Vins et alcools Chevalier", "59 rue de l'Abbaye", "France"));
//cust.Add(new Customer("WANDK", "Rita Müller", "Die Wandernde Kuh", "Adenauerallee 900", "Germany"));
//cust.Add(new Customer("WARTH", "Pirkko Koskitalo", "Wartian Herkku", "Torikatu 38", "Finland"));
//cust.Add(new Customer("WELLI", "Paula Parente", "Wellington Importadora", "Rua do Mercado, 12", "Brazil"));
//cust.Add(new Customer("WHITC", "Karl Jablonski", "White Clover Markets", "305 - 14th Ave. S. Suite 3B", "USA"));
//cust.Add(new Customer("WILMK", "Matti Karttunen", "Wilman Kala", "Keskuskatu 45", "Finland"));
//cust.Add(new Customer("WOLZA", "Zbyszek Piestrzeniewicz", "Wolski Zajazd", "ul. Filtrowa 68", "Poland"));
return cust;
}
public string CustomerID { get; set; }
public string ContactName { get; set; }
public string CompanyName { get; set; }
public string Address { get; set; }
public string Country { get; set; }
}
public class EmployeeDetails
{
public EmployeeDetails()
{
}
public EmployeeDetails(string EmployeeID, string Name, string MailID, string PhoneNumber, string Designation, string ReportTo, string Location, string AssetKit , DateTime AssetKitDistribution, string EmployeeAvailability, string Team, DateTime DateOfJoining, string YearOfExperience, string SoftwareTeam)
{
this.EmployeeID = EmployeeID;
this.Name = Name;
this.MailID = MailID;
this.PhoneNumber = PhoneNumber;
this.Designation = Designation;
this.ReportTo = ReportTo;
this.Location = Location;
this.AssetKit = AssetKit;
this.AssetKitDistribution = AssetKitDistribution;
this.EmployeeAvailability = EmployeeAvailability;
this.Team = Team;
this.DateOfJoining = DateOfJoining;
this.YearOfExperience = YearOfExperience;
this.SoftwareTeam = SoftwareTeam;
}
public string EmployeeID { get; set; }
public string Name { get; set; }
public string MailID { get; set; }
public string PhoneNumber { get; set; }
public string Designation { get; set; }
public string ReportTo { get; set; }
public string Location { get; set; }
public string AssetKit { get; set; }
public DateTime AssetKitDistribution { get; set; }
public string EmployeeAvailability { get; set; }
public string Team { get; set; }
public DateTime DateOfJoining { get; set; }
public string YearOfExperience { get; set; }
public string SoftwareTeam { get; set; }
public static List<EmployeeDetails> GetAllRecords()
{
List<EmployeeDetails> Emp = new List<EmployeeDetails>();
Emp.Add(new EmployeeDetails("Emp1001", "John", "john@abc.com", "(711) 555-4444", "Sales Representative", "Vinet", "Reims", "Headset, Laptop, Phone", new DateTime(1948, 12, 08), "Available", "Sales", new DateTime(1948, 12, 08), "3 Years", "Web-General"));
Emp.Add(new EmployeeDetails("Emp1002", "Suyama", "suyama@abc.com", "(206) 555-1189", "Marketing Manager", "Suprd", "Albuquerque", "Laptop, Projector, Tablet", new DateTime(1952, 02, 19), "Available", "Marketing", new DateTime(1952, 02, 19), "1 Year 10 Months", "Web-Server"));
Emp.Add(new EmployeeDetails("Emp1003", "Janet", "janet@abc.com", "(710) 555-5598", "HR Specialist", "Hanar", "Barquisimeto", "Headset, Laptop, Printer", new DateTime(1963, 08, 30), "Not Available", "Human Resources", new DateTime(1963, 08, 30), "1 Year", "Web-General"));
Emp.Add(new EmployeeDetails("Emp1004", "Peacock", "peacock@abc.com", "(811) 555-7773", "Sales Representative", "Vinet", "Albuquerque", "Headset, Laptop, Phone", new DateTime(1937, 09, 19), "Available", "Sales", new DateTime(1937, 09, 19), "2 Years", "Window"));
Emp.Add(new EmployeeDetails("Emp1005", "Leverling", "leverling@abc.com", "(712) 555-4848", "IT Support", "Tomsp", "Reims", "Keyboard, Laptop, Mouse", new DateTime(1955, 03, 04), "Not Available", "IT Department", new DateTime(1955, 03, 04), "5 Years 3 Months", "Web-Server"));
Emp.Add(new EmployeeDetails("Emp1006", "Fuller", "fuller@abc.com", "(206) 555-8122", "HR Specialist", "Victe", "Barquisimeto", "Headset, Laptop, Printer", new DateTime(1963, 07, 02), "Available", "Human Resources", new DateTime(1963, 07, 02), "3 Years 1 Month", "Designer"));
Emp.Add(new EmployeeDetails("Emp1007", "Buchanan", "buchanan@abc.com", "(206) 555-3412", "Marketing Manager", "Hanar", "Reims", "Laptop, Projector, Tablet", new DateTime(1960, 05, 29), "Not Available", "Marketing", new DateTime(1960, 05, 29), "4 Years", "Support"));
Emp.Add(new EmployeeDetails("Emp1008", "Davolio", "davolio@abc.com", "(206) 555-9482", "Customer Service", "Vinet", "Albuquerque", "Headset, Laptop, Phone", new DateTime(1958, 01, 09), "Not Available", "Customer Support", new DateTime(1958, 01, 09), "11 Months", "Web-Server"));
Emp.Add(new EmployeeDetails("Emp1009", "Robert", "robert@abc.com", "(206) 555-9857", "Finance Analyst", "Suprd", "Reims", "Calculator, Headset, Laptop", new DateTime(1966, 01, 27), "Available", "Finance", new DateTime(1966, 01, 27), "3 Years 5 Months", "Testing"));
return Emp;
}
}
public class TaskDetail
{
public TaskDetail()
{
}
public TaskDetail(string Id, string Title, string Status, string Summary, string Type, string Priority, string Tags , Double Estimate, Double Spent, string Assignee, int RankId)
{
this.Id = Id;
this.Title = Title;
this.Status = Status;
this.Summary = Summary;
this.Type = Type;
this.Priority = Priority;
this.Tags = Tags;
this.Estimate = Estimate;
this.Spent = Spent;
this.Assignee = Assignee;
this.RankId = RankId;
}
public string Id { get; set; }
public string Title { get; set; }
public string Status { get; set; }
public string Summary { get; set; }
public string Type { get; set; }
public string Priority { get; set; }
public string Tags { get; set; }
public Double Estimate { get; set; }
public Double Spent { get; set; }
public string Assignee { get; set; }
public int RankId { get; set; }
public static List<TaskDetail> GetAllRecords()
{
List<TaskDetail> task = new List<TaskDetail>();
task.Add(new TaskDetail { Id = "Task 1", Title = "Task - 29001", Status = "Open", Summary = "Analyze the new requirements gathered from the customer.", Type = "Story", Priority = "Low", Tags = "Analyze,Customer", Estimate = 3.5, Spent = 2, Assignee = "John", RankId = 1 });
task.Add(new TaskDetail { Id = "Task 2", Title = "Task - 29002", Status = "InProgress", Summary = "Improve application performance.", Type = "Improvement", Priority = "Normal", Tags = "Improvement", Estimate = 6, Spent = 12, Assignee = "Suyama", RankId = 1 });
task.Add(new TaskDetail { Id = "Task 3", Title = "Task - 29003", Status = "Open", Summary = "Arrange a web meeting with the customer to get new requirements.", Type = "Others", Priority = "Critical", Tags = "Meeting", Estimate = 5.5, Spent = 0, Assignee = "Janet", RankId = 2 });
// ... 27 more rows
return task;
}
}
}
}
@* Install once: Install-Package Lumen.UI.Mvc (or: dotnet add package Lumen.UI.Mvc) *@
@* Views/Web.config: <add namespace="Lumen.UI.Mvc" /> *@
@* Views/Shared/_Layout.cshtml *@
<head>
@Html.UiStyles()
<link rel="stylesheet" href="~/Content/site.css" />
</head>
<body>
@RenderBody()
@Html.UiScripts()
@RenderSection("scripts", required: false)
</body>
@* Grids with a DataUrl: @Html.AntiForgeryToken() on the page and [HttpPost, ValidateJsonAntiForgeryToken] on the action. *@
This additional information can be shown or hidden by clicking on the expand or collapse button. The detailTemplate property accepts either string or HTML element`s ID value, which will be used as the template for the detail row.
In this demonstration, the parent row provides information about employees: name, id, team and reporter name. In each employee row with a details view, while expanding the details, You can see the sprint report of that employee. In the details row with two tabs. first tab contains Syncfusion Kanban component is used to list of assigned task and it current statuses and second tab contains Syncfusion Chart Component and it is used to display the burndown chart of employee task estimated time vs actual spend time.
The template expression should be provided inside ${...} interpolation syntax.