Change card order in column using code

Hi,

I'm trying to work out how to move kanban cards around via code.  I worked out it's fairly easy to change the column a card is in by simply setting the Category property of underlying model, but I can't figure out how to change the order a card is within a column (i.e.: Move up or down or move to index / row 2 for instance).

Thanks in advance,

Mike

1 Reply

MK Muneesh Kumar G Syncfusion Team August 13, 2018 12:30 PM UTC

Hi Mike, 
 
Thanks for using Syncfusion products.  
 
We have analyzed your requirement and you can achieve this by moving the card’s position in the ActualColumn as per the below code snippet.  
 
int newIndex; 
 
if (!string.IsNullOrEmpty(this.IndexTextBox.Text) && int.TryParse(this.IndexTextBox.Text, out newIndex) 
    && newIndex < this.Kanban.ActualColumns[0].Cards.Count) 
{ 
    this.Kanban.ActualColumns[0].Cards.Move(0, newIndex); 
} 
 
We have prepared a sample based on this, please find the sample from the following location.  
 
 
Hope this helps.  
 
Regards, 
Muneesh Kumar G. 


Loader.
Up arrow icon