3 Sep 2020 / 1 minute to read

This feature is used to define the flow of card transition from one state to another. Create an instance of KanbanWorkflow class and add it to the SfKanban.Workflows property to define the workflow for each column. The KanbanWorkflow contains the following properties to define the source category and target categories:

  • Category: Defines the source category/state.
  • AllowedTransitions: Defines a list of categories/states. The card with the state specified in KanbanWorkflow.Category is allowed to transit.

The following code sample demonstrates the workflow functionality.

  • c#
  • var workflows = new List<KanbanWorkflow>();
    var openWorkflow = new KanbanWorkflow();  
    openWorkflow.Category = "Open"; 
    //Define a list of categories that accepts the cards from open state.
    openWorkflow.AllowedTransitions = new List<object> { "In Progress" }; 
    var progressWorkflow = new KanbanWorkflow(); 
    progressWorkflow.Category = "In Progress"; 
    //Define a list of categories that accepts the cards from “In Progress” state.
    progressWorkflow.AllowedTransitions = new List<object> { "Open", "Code Review", "Closed-No Code Changes" }; 
    kanban.Workflows = workflows;

    In the following screenshot, you can see a card picked from open state is not allowed to drop on “Code Review” and “Done” states, because the cards have been defined to move from Open to “In Progress” state only.