[How To] How to load columns from my internal database?

I have some issues while loading columns from my database.
 Is there a way to get columns if I don't have cards on it? 
Some of my columns doesn't have items, so sfkanban doesn't load it, is there a way to solve it? Thank you! :) 

7 Replies 1 reply marked as answer

YP Yuvaraj Palanisamy Syncfusion Team February 3, 2021 11:25 AM UTC

Hi Rafael, 
 
Greetings from Syncfusion. 
 
You can create data for the collection property to hold the collection of KanbanModel and bind the data to SfKanban using ItemsSource property. Based on the collection, by default Kanban column has been created.  
 
Please refer the below link for more details 
 
You can define the column in Xamarin.Forms Kanban control. Please refer the below link.  
 
The above definitions are not meet your requirement, please update us with more information about this, which will be helpful to provide you better solution at the earliest. 
 
Regards, 
Yuvaraj. 


Marked as answer

RA Rafael replied to Yuvaraj Palanisamy February 3, 2021 12:53 PM UTC

Hi Rafael, 
 
Greetings from Syncfusion. 
 
You can create data for the collection property to hold the collection of KanbanModel and bind the data to SfKanban using ItemsSource property. Based on the collection, by default Kanban column has been created.  
 
Please refer the below link for more details 
 
You can define the column in Xamarin.Forms Kanban control. Please refer the below link.  
 
The above definitions are not meet your requirement, please update us with more information about this, which will be helpful to provide you better solution at the earliest. 
 
Regards, 
Yuvaraj. 


Is it possible to have empty columns on SfKanban? Or by default columns are created based on my ItemSource property? 


YP Yuvaraj Palanisamy Syncfusion Team February 4, 2021 01:09 PM UTC

Hi Rafael, 
 
We have analyzed your query and we have achieved your requirement “Kanban Column with empty card item” by using AutoGenerateColumns property of Kanban. Please refer the below code example below. 
 
CodeSnippet[Xaml]: 
<kanban:SfKanban x:Name="kanban"  
                 AutoGenerateColumns="False"  
                 HorizontalOptions="FillAndExpand"  
                 VerticalOptions="FillAndExpand"  
                 ItemsSource="{Binding Cards}"> 
    <kanban:SfKanban.Columns> 
 
        <kanban:KanbanColumn x:Name="openColumn" Title="Open"  > 
        </kanban:KanbanColumn> 
 
        <kanban:KanbanColumn x:Name="progressColumn" Title="In Progress"> 
        </kanban:KanbanColumn> 
 
        <kanban:KanbanColumn x:Name="codeColumn" Title="Code Review" > 
        </kanban:KanbanColumn> 
 
        <kanban:KanbanColumn x:Name="doneColumn" Title="Done"  > 
        </kanban:KanbanColumn> 
 
    </kanban:SfKanban.Columns> 
</kanban:SfKanban> 
 
Also, please find the same from the below link. 
 
  
Regards, 
Yuvaraj 



RA Rafael replied to Yuvaraj Palanisamy February 4, 2021 01:13 PM UTC

Hi Rafael, 
 
We have analyzed your query and we have achieved your requirement “Kanban Column with empty card item” by using AutoGenerateColumns property of Kanban. Please refer the below code example below. 
 
CodeSnippet[Xaml]: 
<kanban:SfKanban x:Name="kanban"  
                 AutoGenerateColumns="False"  
                 HorizontalOptions="FillAndExpand"  
                 VerticalOptions="FillAndExpand"  
                 ItemsSource="{Binding Cards}"> 
    <kanban:SfKanban.Columns> 
 
        <kanban:KanbanColumn x:Name="openColumn" Title="Open"  > 
        </kanban:KanbanColumn> 
 
        <kanban:KanbanColumn x:Name="progressColumn" Title="In Progress"> 
        </kanban:KanbanColumn> 
 
        <kanban:KanbanColumn x:Name="codeColumn" Title="Code Review" > 
        </kanban:KanbanColumn> 
 
        <kanban:KanbanColumn x:Name="doneColumn" Title="Done"  > 
        </kanban:KanbanColumn> 
 
    </kanban:SfKanban.Columns> 
</kanban:SfKanban> 
 
Also, please find the same from the below link. 
 
  
Regards, 
Yuvaraj 


Using this code, is there any way to bind columns too?  
Like, for example:

<kanban:SfKanban.Columns>
<kanban:KanbanColumn x:Name="openColumn" Title="{Binding Columns"} />
</kanban:SfKanban.Columns>

Or something like that?



YP Yuvaraj Palanisamy Syncfusion Team February 5, 2021 04:34 AM UTC

Hi Rafael, 
 
We have analyzed your query and we have achieved your requirement with the help of Binding the KanbanColumnCollection to Columns property of Kanban. Please refer the below code snippet. 
 
CodeSnippet: 
<kanban:SfKanban x:Name="kanban" 
                 Columns="{Binding KanbanColumns}" 
                 AutoGenerateColumns="False"  
                 HorizontalOptions="FillAndExpand"  
                 VerticalOptions="FillAndExpand"  
                 ItemsSource="{Binding Cards}">      
</kanban:SfKanban> 
 
ViewModel.cs 
public KanbanColumnCollection KanbanColumns { get; set; } 
 
KanbanColumns = new KanbanColumnCollection() 
{ 
    new KanbanColumn() 
    { 
        Categories = new List<object>() { "Open" }, 
        Title = "Open" 
    }, 
    new KanbanColumn() 
    { 
        Categories = new List<object>() { "In Progress" }, 
        Title = "In Progress" 
    }, 
    new KanbanColumn() 
    { 
        Categories = new List<object>() { "Code Review" }, 
        Title = "Code Review" 
    }, 
    new KanbanColumn() 
    { 
        Categories = new List<object>() { "Done" }, 
        Title = "Done" 
    }, 
}; 
 
Also, we have attached the sample for your reference. Please find the sample from the below link. 
 
  
Regards, 
Yuvaraj. 



RA Rafael replied to Yuvaraj Palanisamy February 5, 2021 12:24 PM UTC

Hi Rafael, 
 
We have analyzed your query and we have achieved your requirement with the help of Binding the KanbanColumnCollection to Columns property of Kanban. Please refer the below code snippet. 
 
CodeSnippet: 
<kanban:SfKanban x:Name="kanban" 
                 Columns="{Binding KanbanColumns}" 
                 AutoGenerateColumns="False"  
                 HorizontalOptions="FillAndExpand"  
                 VerticalOptions="FillAndExpand"  
                 ItemsSource="{Binding Cards}">      
</kanban:SfKanban> 
 
ViewModel.cs 
public KanbanColumnCollection KanbanColumns { get; set; } 
 
KanbanColumns = new KanbanColumnCollection() 
{ 
    new KanbanColumn() 
    { 
        Categories = new List<object>() { "Open" }, 
        Title = "Open" 
    }, 
    new KanbanColumn() 
    { 
        Categories = new List<object>() { "In Progress" }, 
        Title = "In Progress" 
    }, 
    new KanbanColumn() 
    { 
        Categories = new List<object>() { "Code Review" }, 
        Title = "Code Review" 
    }, 
    new KanbanColumn() 
    { 
        Categories = new List<object>() { "Done" }, 
        Title = "Done" 
    }, 
}; 
 
Also, we have attached the sample for your reference. Please find the sample from the below link. 
 
  
Regards, 
Yuvaraj. 


Thank you! :) It worked here! 


YP Yuvaraj Palanisamy Syncfusion Team February 8, 2021 06:16 AM UTC

Hi Rafael,  
 
Thanks for your Update. Please let us know if you need any further assistance. 
 
Regards,  
Yuvaraj.  


Loader.
Up arrow icon