Example of Overview in ASP.NET MVC Kanban Control
This sample demonstrates a comprehensive task management solution built with the Kanban component, showcasing key features such as card and header customization, swimlane organization, tooltips, and column visibility management to enhance workflow tracking and collaboration.
<template id="kanban-col-todo"><span class="ui-kanban-col-icon ui-kanban-col-todo"></span>To Do</template>
<template id="kanban-col-progress"><span class="ui-kanban-col-icon ui-kanban-col-progress"></span>In Progress</template>
<template id="kanban-col-done"><span class="ui-kanban-col-icon ui-kanban-col-done"></span>Done</template>
<template id="kanban-col-review"><span class="ui-kanban-col-icon ui-kanban-col-review"></span>In Review</template>
<template id="kanban-overview-card"><div class="ui-kanban-tpl-title">${Id}</div><div class="ui-kanban-tpl-content">${Summary}</div><div class="ui-kanban-tpl-foot"><span class="ui-kanban-tag">${Tag1}</span><span class="ui-kanban-tag">${Tag2}</span><span class="ui-kanban-avatar">${Initials}</span></div></template>
@Html.UiKanban(new UiKanbanOptions
{
Id = "overviewBoard",
DataSource = (IEnumerable<object>)ViewData["DataSource"],
CardSettings = new UiKanbanCardSettings { HeaderField = "Id", ContentField = "Summary", GrabberField = "Cls", Template = "#kanban-overview-card" },
Columns = new List<UiKanbanColumn>
{
new UiKanbanColumn { KeyField = "Open", HeaderText = "To Do", AllowToggle = true, ShowItemCount = false, Template = "#kanban-col-todo" },
new UiKanbanColumn { KeyField = "InProgress", HeaderText = "In Progress", AllowToggle = true, ShowItemCount = false, Template = "#kanban-col-progress" },
new UiKanbanColumn { KeyField = "Testing, Validate", HeaderText = "In Review", AllowToggle = true, ShowItemCount = false, Template = "#kanban-col-review" },
new UiKanbanColumn { KeyField = "Close", HeaderText = "Done", AllowToggle = true, ShowItemCount = false, Template = "#kanban-col-done" }
},
KeyField = "Status",
EnableTooltip = true,
SwimlaneSettings = new UiKanbanSwimlaneSettings { KeyField = "Assignee" },
Height = "auto",
AriaLabel = "Release workflow board"
})
<template id="kanban-col-todo"><span class="ui-kanban-col-icon ui-kanban-col-todo"></span>To Do</template>
<template id="kanban-col-progress"><span class="ui-kanban-col-icon ui-kanban-col-progress"></span>In Progress</template>
<template id="kanban-col-done"><span class="ui-kanban-col-icon ui-kanban-col-done"></span>Done</template>
<template id="kanban-col-review"><span class="ui-kanban-col-icon ui-kanban-col-review"></span>In Review</template>
<style>
.ui-kanban-col-icon { align-items: center; border-radius: 3px; color: #fff; display: inline-flex; font-size: 11px; height: 16px; justify-content: center; margin-right: 8px; width: 16px; }
.ui-kanban-col-todo { background: #2563eb; }
.ui-kanban-col-progress { background: #f59e0b; }
.ui-kanban-col-review { background: #9c27b0; }
.ui-kanban-col-done { background: #43a047; }
.ui-kanban-col-todo::before { content: "\2630"; }
.ui-kanban-col-progress::before { content: "\2731"; }
.ui-kanban-col-review::before { content: "\25C9"; }
.ui-kanban-col-done::before { content: "\2714"; }
</style>
<style>
.ui-kanban-card-grabber.sf-low { background: #7ed321; }
.ui-kanban-card-grabber.sf-normal { background: #f5c518; }
.ui-kanban-card-grabber.sf-critical { background: #9c27b0; }
.ui-kanban-card-grabber.sf-breaker { background: #e53935; }
</style>
<style>
.ui-kanban-tpl-title { font-size: 14px; font-weight: 400; line-height: 1.625; padding: 12px 14px 0; }
.ui-kanban-tpl-content { font-size: 14px; line-height: 1.625; padding: 12px 14px 0; }
.ui-kanban-tpl-foot { align-items: center; display: flex; gap: 4px; justify-content: space-between; padding: 12px 14px 12px 10px; }
.ui-kanban-tpl-foot .ui-kanban-tag { background: #ededed; border-radius: 2px; font-size: 12px; padding: 2px 6px; }
.ui-kanban-tpl-foot .ui-kanban-tag:empty { display: none; }
.ui-kanban-avatar { align-items: center; background: #ededed; border-radius: 50%; color: #424242; display: inline-flex; font-size: 11px; font-weight: 600; height: 30px; justify-content: center; margin-left: auto; width: 30px; }
</style>
<template id="kanban-overview-card"><div class="ui-kanban-tpl-title">${Id}</div><div class="ui-kanban-tpl-content">${Summary}</div><div class="ui-kanban-tpl-foot"><span class="ui-kanban-tag">${Tag1}</span><span class="ui-kanban-tag">${Tag2}</span><span class="ui-kanban-avatar">${Initials}</span></div></template>
@Html.UiKanban(new UiKanbanOptions
{
Id = "overviewBoard",
DataSource = (IEnumerable<object>)ViewData["DataSource"],
CardSettings = new UiKanbanCardSettings { HeaderField = "Id", ContentField = "Summary", GrabberField = "Cls", Template = "#kanban-overview-card" },
Columns = new List<UiKanbanColumn>
{
new UiKanbanColumn { KeyField = "Open", HeaderText = "To Do", AllowToggle = true, ShowItemCount = false, Template = "#kanban-col-todo" },
new UiKanbanColumn { KeyField = "InProgress", HeaderText = "In Progress", AllowToggle = true, ShowItemCount = false, Template = "#kanban-col-progress" },
new UiKanbanColumn { KeyField = "Testing, Validate", HeaderText = "In Review", AllowToggle = true, ShowItemCount = false, Template = "#kanban-col-review" },
new UiKanbanColumn { KeyField = "Close", HeaderText = "Done", AllowToggle = true, ShowItemCount = false, Template = "#kanban-col-done" }
},
KeyField = "Status",
EnableTooltip = true,
SwimlaneSettings = new UiKanbanSwimlaneSettings { KeyField = "Assignee" },
Height = "auto",
AriaLabel = "Release workflow board"
})
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class KanbanController : Controller
{
// The page is Views/Kanban/Overview.cshtml; it draws what ViewData holds.
public ActionResult Overview()
{
ViewData["DataSource"] = OverviewCards();
return View();
}
private const string Open = "Open";
private const string InProgress = "InProgress";
/// <summary>Syncfusion's Overview data: tasks by assignee, a priority (its colour), and up to two tags.</summary>
private static List<object> OverviewCards()
{
// Syncfusion's Overview data: tasks by assignee, a priority (its colour), and up to two tags.
string[][] rows =
{
new[] { "Task - 29033", "Open", "Arrange web meeting with customer to get editing requirements.", "sf-breaker", "Story", "Improvement", "Andrew Fuller" },
new[] { "Task - 29002", "InProgress", "Add responsive support to applicaton.", "sf-normal", "Story", "Kanban", "Andrew Fuller" },
new[] { "Task - 29004", "InProgress", "Fix the issues reported in the IE browser.", "sf-critical", "Bug", "Customer", "Andrew Fuller" },
new[] { "Task - 29016", "Testing", "Fix the issues reported in IE browser.", "sf-critical", "Bug", "Customer", "Andrew Fuller" },
new[] { "Task - 29018", "Close", "Arrange web meeting with customer to get login page requirement.", "sf-critical", "Feature", "", "Andrew Fuller" },
new[] { "Task - 29025", "Close", "Add input validation for editing.", "sf-breaker", "Bug", "Breaking Issue", "Andrew Fuller" },
new[] { "Task - 29003", "Open", "Show the retrived data from the server in grid control.", "sf-breaker", "Bug", "Breaking Issue", "Janet Leverling" },
new[] { "Task - 29030", "InProgress", "Test editing functionality.", "sf-normal", "Story", "", "Janet Leverling" },
new[] { "Task - 29017", "Testing", "Enhance editing functionality.", "sf-low", "Story", "Kanban", "Janet Leverling" },
new[] { "Task - 29022", "Close", "Analyze stored procedure.", "sf-breaker", "CustomSample", "", "Janet Leverling" },
new[] { "Task - 29031", "Open", "Fix the issues reported by the customer.", "sf-normal", "Bug", "Customer", "Janet Leverling" },
new[] { "Task - 29019", "Validate", "Validate the new requirements.", "sf-low", "Story", "", "Janet Leverling" }
};
return rows.Select(r => (object)new Dictionary<string, object>
{
{ "Id", r[0] }, { "Status", r[1] }, { "Summary", r[2] }, { "Cls", r[3] }, { "Tag1", r[4] }, { "Tag2", r[5] },
{ "Tags", string.Join(",", new[] { r[4], r[5] }.Where(t => t.Length > 0)) }, { "Type", r[4] }, { "Estimate", (Array.IndexOf(rows, r) % 5 + 1) * 0.5 },
{ "Assignee", r[6] }, { "Initials", string.Concat(r[6].Split(' ').Select(w => w.Substring(0, 1))) }
}).ToList();
}
}
}
@* 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>
This sample demonstrates a comprehensive task management scenario built with the Kanban component. It combines multiple features, including customized card and column header templates, swimlane grouping, tooltips, and column toggling to create an interactive workflow management experience.
The board is populated using a predefined task collection bound through the DataSource property. Tasks are organized into Columns based on their Status field and grouped into swimlanes according to the assigned resource, providing a clear view of task ownership and progress.