Column header template and disallow to drop

Hi
I want to create a button in header line
And I want to not allow to drop any card to there
How can I do ? please help 

The pictures for question are below





1 Reply 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team July 17, 2020 12:04 PM UTC

Hi Cemil, 

Greetings from Syncfusion Support. 

Query 1: “I want to create a button in header line” 
We have validated your requirement at our side and let you know that, it can be done by making use of the below code snippet. 

<button class="e-btn" @onclick="@AddColumn">Add New Card</button> 

private void AddColumn() 
    KanbanDataModel data = new KanbanDataModel() 
   
        Id = (this.Tasks.Count() + 1).ToString(), 
        Title = "", 
        Tags = "", 
        Estimate = 0, 
        Summary = "", 
        Status = "Open", 
        Type = "Story", 
        Priority = "Low", 
        Assignee = "Nancy Davloio" 
    }; 
    this.KanbanRef.OpenDialog(CurrentAction.Add, data); 

Query 2: “And I want to not allow to drop any card to there” 
We have analyzed your requirement at our side and prepared a sample based on that using DragStop event of the Kanban like the below code snippet. 

private void onDragStop(Syncfusion.Blazor.Kanban.DragEventArgs args) 
    if (KanbanRef.Columns[4].HeaderText == "Add column") 
   
        args.Cancel = true; 
   


Kindly try the above solution and let us know if this is helpful. 

Regards, 
Balasubramanian S 


Marked as answer
Loader.
Up arrow icon