Hello
I read the documents of the site. Thank you for answering the following questions about the Kanban component.
1-In each column, when I change the order of the cards, it is not applied. I want the order to be preserved based on the user's changes.
The second thing is, based on which event, should I notice the order change in the columns and save the information in the database? Until next time, I will show the order of the user based on the latest changes.
2-I used the CardDoubleClick Event to display my dialog. After double clicking, syncfusion dialog will be displayed. How can I prevent the default dialog from showing?
3-How can I change the background color of each column?
4-How can I change the background color of the card?
5-How can I reduce the distance between the cards in the column?
6-How can I change the Kanban component font?
7-How to define context menu for cards?
<SfKanban TValue="TasksModel" KeyField="Status" DataSource="Tasks"> <KanbanColumns> ..... ........ </KanbanColumns> <KanbanEvents TValue="TasksModel" ActionComplete="ActionComplete"></KanbanEvents> <KanbanCardSettings HeaderField="Title" ContentField="Summary"></KanbanCardSettings> </SfKanban> @code { public void ActionComplete(Syncfusion.Blazor.Kanban.ActionEventArgs<TasksModel> args){ } } |
<SfKanban TValue="TasksModel" KeyField="Status" DataSource="Tasks"> <KanbanEvents TValue="TasksModel" DialogOpen="DialogOpen" ActionComplete="ActionComplete"></KanbanEvents> <KanbanCardSettings HeaderField="Title" ContentField="Summary"></KanbanCardSettings> </SfKanban> @code { public void DialogOpen(Syncfusion.Blazor.Kanban.DialogOpenEventArgs<TasksModel> args){ args.Cancel = true; } } |
<style> .e-kanban .e-kanban-table.e-content-table .e-content-row:not(.e-swimlane-row) td[data-key='Open'], .e-kanban .e-kanban-table.e-header-table .e-header-row:not(.e-swimlane-row) th[data-key='Open'] { background-color: grey; } .e-kanban .e-kanban-table.e-content-table .e-content-row:not(.e-swimlane-row) td[data-key='InProgress'], .e-kanban .e-kanban-table.e-header-table .e-header-row:not(.e-swimlane-row) th[data-key='InProgress'] { background-color: yellow; } .e-kanban .e-kanban-table.e-content-table .e-content-row:not(.e-swimlane-row) td[data-key='Testing'], .e-kanban .e-kanban-table.e-header-table .e-header-row:not(.e-swimlane-row) th[data-key='Testing'] { background-color: red; } .e-kanban .e-kanban-table.e-content-table .e-content-row:not(.e-swimlane-row) td[data-key='Close'], .e-kanban .e-kanban-table.e-header-table .e-header-row:not(.e-swimlane-row) th[data-key='Close'] { background-color: green; } </style> |
<KanbanCardSettings HeaderField="Id" ContentField="Summary"> <Template> @{ TasksModel data = (TasksModel)context; <div class="e-card-content" style="background-color:@data.Color"> <table class="card-template-wrap"> <tbody> <tr> <td class="CardHeader">Id:</td> <td>@data.Id</td> </tr> <tr> <td class="CardHeader">Type:</td> <td>@data.Type</td> </tr> <tr> <td class="CardHeader">Priority:</td> <td>@data.Priority</td> </tr> <tr> <td class="CardHeader">Summary:</td> <td>@data.Summary</td> </tr> </tbody> </table> </div> } </Template> </KanbanCardSettings> public class TasksModel { 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 Assignee { get; set; } public string Color { get; set; } } public List<TasksModel> Tasks = new List<TasksModel>() { new TasksModel { Id = "Task 1", Color = "red", Title = "BLAZ-29001", Status = "Open", Summary = "Analyze the new requirements gathered from the customer.", Assignee = "Nancy Davloio", Type = "Story", Priority = "Low" }, new TasksModel { Id = "Task 2",Color = "blue", Title = "BLAZ-29002", Status = "InProgress", Summary = "Improve application performance", Assignee = "Andrew Fuller", Type = "Improvement", Priority = "Normal" }, new TasksModel { Id = "Task 3",Color = "red", Title = "BLAZ-29003", Status = "Open", Summary = "Arrange a web meeting with the customer to get new requirements.", Assignee = "Janet Leverling", Type = "Others", Priority = "Critical" }, new TasksModel { Id = "Task 4",Color = "blue", Title = "BLAZ-29004", Status = "InProgress", Summary = "Fix the issues reported in the IE browser.", Assignee = "Janet Leverling", Type = "Bug", Priority = "Release Breaker" }, new TasksModel { Id = "Task 5",Color = "red", Title = "BLAZ-29005", Status = "Review", Summary = "Fix the issues reported by the customer.", Assignee = "Steven walker", Type = "Bug", Priority = "Low" }, new TasksModel { Id = "Task 6",Color = "blue", Title = "BLAZ-29006", Status = "Review", Summary = "Fix the issues reported in Safari browser.", Assignee = "Nancy Davloio", Type = "Others", Priority = "Low" }, new TasksModel { Id = "Task 7", Color = "red",Title = "BLAZ-29007", Status = "Close", Summary = "Test the application in the IE browser.", Assignee = "Margaret hamilt", Type = "Improvement", Priority = "Low" }, new TasksModel { Id = "Task 8",Color = "blue", Title = "BLAZ-29008", Status = "Validate", Summary = "Validate the issues reported by the customer.", Assignee = "Steven walker", Type = "Story", Priority = "Release Breaker" }, new TasksModel { Id = "Task 9", Color = "red",Title = "BLAZ-29009", Status = "Open", Summary = "Show the retrieved data from the server in grid control.", Assignee = "Margaret hamilt", Type = "Bug", Priority = "Release Breaker" }, } |
<style> .e-kanban .e-kanban-content .e-content-row .e-content-cells .e-card-container .e-card { margin-bottom: 5px !important; } </style> |
<style> .e-kanban .e-kanban-content .e-content-row .e-content-cells .e-card-container .e-card .e-card-content { font-family: cursive ; } .e-kanban .e-kanban-table .e-header-cells .e-header-text { font-family: cursive; } </style> |
Vinitha
Hi Vinitha Jeyakumar,
Thank you for your reply
Hi,
Thank you for your follow up .I used DragStop and ActionComplete events to determine which Kanban Card was dragged from which column to which column, but unfortunately I didn't get the result. Is it possible to help me? I use version 23.1.36.
On further validating the query "Couldn't drag and drop the cards within the same column in Kanban" , we found that in Blazor Platform sortSetting property default is DataSourceOrder. So add the Index property with Field Like below code snippet for Same column drag and drop.
For Reference Link :
https://blazor.syncfusion.com/documentation/kanban/sort#index
<SfKanban TValue="TasksModel" KeyField="Status" DataSource="Tasks"> <KanbanColumns> <KanbanColumn HeaderText="Backlog" 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="Id" ContentField="Summary"></KanbanCardSettings> <KanbanSortSettings SortBy="SortOrderBy.Index" Field="Id1"></KanbanSortSettings> </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 string Assignee { get; set; } public int Id1 { get; set; } } public List<TasksModel> Tasks = new List<TasksModel>() { new TasksModel { Id = "Task 7",Id1 = 7, Title = "BLAZ-29007", Status = "Close", Summary = "Test the application in the IE browser.", Assignee = "Margaret hamilt" }, new TasksModel { Id = "Task 8",Id1 = 8, Title = "BLAZ-29008", Status = "Validate", Summary = "Validate the issues reported by the customer.", Assignee = "Steven walker" }, new TasksModel { Id = "Task 9",Id1 = 9, Title = "BLAZ-29009", Status = "Open", Summary = "Show the retrieved data from the server in grid control.", Assignee = "Margaret hamilt" }, new TasksModel { Id = "Task 10",Id1 = 10, Title = "BLAZ-29010", Status = "InProgress", Summary = "Fix cannot open user’s default database SQL error.", Assignee = "Janet Leverling" }, new TasksModel { Id = "Task 11",Id1 = 11, Title = "BLAZ-29007", Status = "Close", Summary = "Test the application in the IE browser.", Assignee = "Margaret hamilt" }, new TasksModel { Id = "Task 12",Id1 = 12, Title = "BLAZ-29008", Status = "Validate", Summary = "Validate the issues reported by the customer.", Assignee = "Steven walker" }, new TasksModel { Id = "Task 13",Id1 = 13, Title = "BLAZ-29009", Status = "Open", Summary = "Show the retrieved data from the server in grid control.", Assignee = "Margaret hamilt" }, new TasksModel { Id = "Task 14",Id1 = 14, Title = "BLAZ-29010", Status = "InProgress", Summary = "Fix cannot open user’s default database SQL error.", Assignee = "Janet Leverling" }, }; } |
Query ".I used DragStop and ActionComplete events to determine which Kanban Card was dragged from which column to which column, but unfortunately I didn't get the result"
You can get the dragged column details of the Card using the DragStart event and the dropped column details using the DragStop event like below,
Code snippet:
<SfKanban TValue="TasksModel" KeyField="Status" DataSource="Tasks"> <KanbanColumns> ..... </KanbanColumns> <KanbanEvents TValue="TasksModel" DragStart="@DragStart" DragStop="@DragStop"></KanbanEvents> <KanbanCardSettings HeaderField="Id" ContentField="Summary"></KanbanCardSettings> <KanbanSortSettings SortBy="SortOrderBy.Index" Field="Id1"></KanbanSortSettings> </SfKanban> @code { public void DragStart(DragEventArgs<TasksModel> args) { Console.WriteLine("Drag started from", args.Data[0].Status); } public void DragStop(DragEventArgs<TasksModel> args) { Console.WriteLine("Drag stopped to", args.Data[0].Status); } |
Regards,
Vinitha
Hello
Thank you for your reply
How can I reduce the height of the header??
Hi Sarah,
Your requirement to customize the height of the Kanban header can be achieved by using the below CSS styles,
Code snippet:
<style> .e-kanban .e-header-row { height: 60px; } </style> |