SfKanban - refresh diagram
Hi there,


Even when I press "Refresh(StateHasChanged)" there is no update.
Only when I press "Refresh(depricated)" the 3rd task gets visible, but this function is depricated.
So is there a reliable way to refresh your Kanban?
Attachment: Test_8ef60c4c.zip
I have noticed a strange behavior using your Kanban-component, and created a minimalistic example that reveals the bug:
When I press (please keep to the order)
- Add Task
- Modify Task
everything works as expected.
But when I press
- Modify Task
- Add Task
Then the 1st task is modified, but the 3rd task is not rendered.
Even when I press "Refresh(StateHasChanged)" there is no update.
Only when I press "Refresh(depricated)" the 3rd task gets visible, but this function is depricated.
So is there a reliable way to refresh your Kanban?
Any idea?
Cheers,
Volker
Cheers,
Volker
Attachment: Test_8ef60c4c.zip
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
VM
Vengatesh Maniraj
Syncfusion Team
October 8, 2020 02:40 PM UTC
Hi Volker,
Greetings from Syncfusion Support.
We checked your reported problem and we have to let you know that if we want to update the data source by dynamically, we need to pass the entire collection of the data source. If we want to add a single card, we suggest to use the AddCard public method.
Dynamic change:
|
private async System.Threading.Tasks.Task AddTaskkAsync()
{
Tasks = new List<TasksModel>()
{
new TasksModel { Id = "Task 1", Owner="Alice", Status = "Open", Summary = "Lorem ipsum dolor sit amet."},
new TasksModel { Id = "Task 2", Owner="Bob", Status = "Open", Summary = "Consetetur sadipscing elitr."},
new TasksModel { Id = "Task 3", Owner = "Claire", Status = "Open", Summary = " At vero eos et accusam et justo." }
};
await InvokeAsync(() => { StateHasChanged(); });
this.StateHasChanged();
} |
AddCard method:
|
private async System.Threading.Tasks.Task AddTaskkAsync()
{
kanban0.AddCard(new TasksModel { Id = "Task 3", Owner = "Claire", Status = "Open", Summary = " At vero eos et accusam et justo." });
}
|
For your reference, we prepared the sample with the above sample code that can be available in the below link.
Kindly check the above sample and get back to us if you need any further assistance.
Regards,
Vengatesh
VO
Volker
October 8, 2020 03:17 PM UTC
Hi Vengatesh,
Attachment: Test_fab4c064.zip
thank you for support.
I have probably made myself unclear. The question is: "What function do I have to call after someone has made a modification (new/change/delete) in the underlying data-source (e.g. SQL-Server), so that the Kanban diagram in my browser is updated?".
Here is my adapted example:

When you press (1) Modify, the diagram gets re-rendered automatically, no need for a manuel refresh.
When you press (2) Add, the diagramm is not updated. So we call "Update Try 1", still no update. But when we call "Update Try 2", it works.
Same for (3) Remove. Only when we press "Update Try 2" we see the changes:

The only working solution at the moment kanban.Refresh() gets depricated soon by you, and using StateHasChanged() does not work as demonstrated here.
Any idea?
Cheers,
Volker
When you press (2) Add, the diagramm is not updated. So we call "Update Try 1", still no update. But when we call "Update Try 2", it works.
Same for (3) Remove. Only when we press "Update Try 2" we see the changes:
The only working solution at the moment kanban.Refresh() gets depricated soon by you, and using StateHasChanged() does not work as demonstrated here.
Any idea?
Cheers,
Volker
Attachment: Test_fab4c064.zip
VM
Vengatesh Maniraj
Syncfusion Team
October 9, 2020 12:51 PM UTC
Hi Volker,
Thanks for the update.
We deeply investigated your query at our source level and came to the solution is that we have to include the Refresh() method to update the data source by dynamically. So we let you know that we will include the Refresh() method in our source and remove it from deprecated. We will include these changes in our upcoming weekly patch release which is scheduled on October 14, 2020. We appreciate your valuable patience until then.
So we suggest you please use the Refresh() method to achieve your requirement as below.
|
private void Refresh()
{
kanban0.Refresh();
}
|
We will let you know once the patch will be released.
Regards,
Vengatesh
Marked as answer
VO
Volker
October 9, 2020 01:41 PM UTC
Hi Vengatesh,
Cheers from Graz/Austria,
Volker
thank you for your support, this is definitly best-practive in business!!!
I'll keep xxx.Refresh() in the code.
I'll keep xxx.Refresh() in the code.
Cheers from Graz/Austria,
Volker
NR
Nevitha Ravi
Syncfusion Team
October 12, 2020 05:26 AM UTC
Hi Volker,
Thanks for your update. As mentioned earlier, we will ensure the ‘Refresh’ method and update further details on October 14, 2020 once our upcoming weekly patch release has been rolled out.
Regards,
Nevitha
SIGN IN To post a reply.