Syncfusion AI Assistant

How can I help you?

Getting Started with Blazor Kanban Component in Web App

25 May 20269 minutes to read

This section briefly explains about how to include the Syncfusion® Blazor Kanban component in your Blazor Web App using Visual Studio, Visual Studio Code, and the .NET CLI.

Ready to streamline your Syncfusion® Blazor development?
Discover the full potential of Syncfusion® Blazor components with Syncfusion® AI Coding Assistants. Effortlessly integrate, configure, and enhance your projects with intelligent, context-aware code suggestions, streamlined setups, and real-time insights. Explore Syncfusion® AI Coding Assistants

Prerequisites

Create a new Blazor Web App in Visual Studio

Create a Blazor Web App using Visual Studio via Microsoft Templates or the Syncfusion® Blazor Extension. For detailed instructions, refer to the Blazor Web App Getting Started documentation.

Install Syncfusion® Blazor packages

Use Visual Studio’s NuGet Package Manager (Tools → NuGet Package Manager → Manage NuGet Packages for Solution) to install Syncfusion.Blazor.Kanban and Syncfusion.Blazor.Themes.

Alternatively, run the following in the Package Manager Console:

Install-Package Syncfusion.Blazor.Kanban -Version 33.2.3
Install-Package Syncfusion.Blazor.Themes -Version 33.2.3

NOTE

If the Interactive Render Mode is WebAssembly or Auto, install these packages in the Client project of the Blazor Web App.

NOTE

All Syncfusion Blazor packages are available on nuget.org. See the NuGet packages topic for details.

Prerequisites

Create a new Blazor Web App in Visual Studio Code

Create a Blazor Web App using Visual Studio Code via Microsoft Templates or the Syncfusion® Blazor Extension. For detailed instructions, refer to the Blazor Web App Getting Started documentation.

For example, in a Blazor Web App with the Auto interactive render mode, use the following commands in the integrated terminal (Ctrl+`):

dotnet new blazor -o BlazorWebApp -int Auto
cd BlazorWebApp
cd BlazorWebApp.Client

Install Syncfusion® Blazor packages

From the integrated terminal, add the required packages of Syncfusion.Blazor.Kanban and Syncfusion.Blazor.Themes to the project:

dotnet add package Syncfusion.Blazor.Kanban --version 33.2.3
dotnet add package Syncfusion.Blazor.Themes --version 33.2.3

NOTE

If the Interactive Render Mode is WebAssembly or Auto, run the above commands in the Client project folder (for example, BlazorWebApp.Client).

NOTE

All Syncfusion Blazor packages are available on nuget.org. See the NuGet packages topic for details.

Prerequisites

Install the latest version of .NET SDK. If you previously installed the SDK, determine the installed version by executing the following command in a command prompt (Windows) or terminal (macOS) or command shell (Linux).

dotnet --version

Create a Blazor Web App using .NET CLI

Run the following command to create a new Blazor Web App in a command prompt (Windows) or terminal (macOS) or command shell (Linux). For detailed instructions, refer to the Blazor Web App Getting Started documentation.

For example, in a Blazor Web App with the Auto interactive render mode, use the following commands:

dotnet new blazor -o BlazorWebApp -int Auto
cd BlazorWebApp
cd BlazorWebApp.Client

Install Syncfusion® Blazor packages

Run the following commands to add the packages of Syncfusion.Blazor.Kanban and Syncfusion.Blazor.Themes:

dotnet add package Syncfusion.Blazor.Kanban --version 33.2.3
dotnet add package Syncfusion.Blazor.Themes --version 33.2.3

NOTE

If the Interactive Render Mode is WebAssembly or Auto, execute the commands in the Client project (for example, BlazorWebApp.Client).

NOTE

All Syncfusion Blazor packages are available on nuget.org. See the NuGet packages topic for details.

NOTE

Configure the appropriate Interactive render mode and Interactivity location while creating a Blazor Web App. For detailed information, refer to the interactive render mode documentation.

Register Syncfusion® Blazor service

Register the Syncfusion Blazor service in the Program.cs file of your Blazor Web App.

....
using Syncfusion.Blazor;
....
builder.Services.AddSyncfusionBlazor();
....

NOTE

If the Interactive Render Mode is set to WebAssembly or Auto, register the Syncfusion® Blazor service in Program.cs files of both the server and client projects in your Blazor Web App.

Add stylesheet and script resources

The theme stylesheet and script can be accessed from NuGet through Static Web Assets. Include the stylesheet and script references in the ~/Components/App.razor file.

  • Add the stylesheet reference inside the <head> tag of the App.razor file.
  • Add the script reference inside the <body> tag of the App.razor file.
<link href="_content/Syncfusion.Blazor.Themes/fluent2.css" rel="stylesheet" />
....
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>

NOTE

Check out the Blazor Themes topic to discover various methods (Static Web Assets, CDN, and CRG) for referencing themes in your Blazor application. Also, check out the Adding Script Reference topic to learn different approaches for adding script references in your Blazor application.

Add Syncfusion® Blazor Kanban component

Add the Syncfusion Blazor Kanban component in the ~/Components/Pages/*.razor file. If the interactivity location is set to Per page/component in the Web App, define a render mode at the top of the ~/Pages/*.razor file. (For example, InteractiveServer, InteractiveWebAssembly or InteractiveAuto).

NOTE

If the Interactivity Location is set to Global with Auto or WebAssembly, the render mode is automatically configured in the App.razor file by default.

@* desired render mode define here *@
@rendermode InteractiveAuto
@using Syncfusion.Blazor.Kanban

<SfKanban TValue="TasksModel" KeyField="Status" DataSource="Tasks">
    <KanbanColumns>
        <KanbanColumn HeaderText="To Do" KeyField="@(new List<string>() {"Open"})"></KanbanColumn>
        <KanbanColumn HeaderText="In Progress" KeyField="@(new List<string>() {"InProgress"})"></KanbanColumn>
        <KanbanColumn HeaderText="Testing" KeyField="@(new List<string>() {"Testing"})"></KanbanColumn>
        <KanbanColumn HeaderText="Done" KeyField="@(new List<string>() {"Close"})"></KanbanColumn>
    </KanbanColumns>
    <KanbanCardSettings HeaderField="Title" ContentField="Summary"></KanbanCardSettings>
</SfKanban>

@code {
    public class TasksModel
    {
        public string Id { get; set; }
        public string Title { get; set; }
        public string Status { get; set; }
        public string Summary { get; set; }
    }

    public List<TasksModel> Tasks = new List<TasksModel>()
    {
        new TasksModel { Id = "Task 1", Title = "BLAZ-29001", Status = "Open", Summary = "Analyze the new requirements gathered from the customer." },
        new TasksModel { Id = "Task 2", Title = "BLAZ-29002", Status = "Open", Summary = "Show the retrieved data from the server in grid control." },
        new TasksModel { Id = "Task 3", Title = "BLAZ-29003", Status = "InProgress", Summary = "Improve application performance" },
        new TasksModel { Id = "Task 4", Title = "BLAZ-29004", Status = "Testing", Summary = "Fix the issues reported by the customer." },
        new TasksModel { Id = "Task 5", Title = "BLAZ-29005", Status = "Testing", Summary = "Fix the issues reported in Safari browser." },
        new TasksModel { Id = "Task 6", Title = "BLAZ-29006", Status = "Close", Summary = "Analyze SQL server 2008 connection." },
        new TasksModel { Id = "Task 7", Title = "BLAZ-29007", Status = "Close", Summary = "Analyze grid control." },
        new TasksModel { Id = "Task 8", Title = "BLAZ-29008", Status = "Close", Summary = "Stored procedure for initial data binding of the grid." }
    };
}

Run the application

Visual Studio:

  • Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. The Blazor Gantt Chart component will render in your default web browser.

Visual Studio Code or .NET CLI:

  1. Open the terminal (Visual Studio Code) or command prompt (.NET CLI) and navigate to the Client project folder.
  2. Run the following command:

     dotnet run
    
  3. The application will start and display in your default web browser.

NOTE

You can also explore our Blazor Kanban Board example that shows you how to render and configure the Kanban Board.

See also

  1. Getting Started with Syncfusion® Blazor WebAssembly App in Visual Studio or .NET CLI
  2. Getting Started with Syncfusion® Blazor Web App in Visual Studio or .NET CLI