We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Categories Property only accepts strings and not objects

I'm currently trying to do a customized implementation of the SfKanban control. I am generating the columns using a database, and then want to populate the cards using a foreign key relationship to the columns. See below. 

            Kanban = new SfKanban();
            Kanban.AutoGenerateColumns = false;
            Kanban.ColumnMappingPath = "AssignedSwimLane"; //This is on the card. Assigned swimlane is an integer mapping to the column which contains the column name and other details. 

            BoardColumns = Core.Helpers.SwimlaneHelper.GetAllSwimlanes();
            AllJobs = Core.Helpers.JobHelper.GetJobs();

            foreach (var s in BoardColumns)
            {
                KanbanColumn openColumn = new KanbanColumn();
                openColumn.Title = s.SlName;
                openColumn.Categories = s.SlId; //SlId is an integer Assigned swimlane references this value. This cannot be used because Categories accepts only a string. 
                Kanban.Columns.Add(openColumn);
            }

According to the documentation, I should be able to set the categories using a list of objects: 
progressColumn.Categories = new List<object>() { "In Progress", "Validated" };
In the Xamarin Forms version of this project, I used the following successfully: 

            foreach( var s in Swimlanes)
            {
                KanbanColumn openColumn = new KanbanColumn();
                openColumn.Title = s.SlName;
                openColumn.Categories = new System.Collections.Generic.List<object> { s.SlId };
                KanBan.Columns.Add(openColumn);
            }

This works for Xamarin, but not for WPF. Can I override the categories property to allow usage of an integer? 

3 Replies

MK Muneesh Kumar G Syncfusion Team August 21, 2019 12:49 PM UTC

Hi Patrick, 
 
Greetings from Syncfusion.  
 
We have analyzed your requirement and we would like to inform you that in WPF SfKanban’s Categories property type is string. So, if you want to define the swimlane support in WPF, you have to initialize SwimlaneKey property in SfKanban. Please refer below user documentation for more details about this support.  
 
 
 
Please let us know if you have any other queries.  
 
Regards,  
Muneesh Kumar G 
 



PF Patrick Fic August 21, 2019 03:38 PM UTC

Could you please elaborate on the inconsistency of the functionality of the product between platforms? Are there any plans to address both the outdated/incorrect documentation and the consistency? 


LR Lakshmi Radha Krishnan Syncfusion Team August 22, 2019 12:09 PM UTC

 

Hi Patrick,

 

Due to the SfKanban lateral implementation in Xamarin.Forms. We have some behaviour inconsistency among the Xamarin and WPF platform.

 

WPF Implementation:

 

As we have mentioned earlier, you need to define the SwinlaneKey property if you expect to show more than one category in the same column as described in the below link. The categories which is defined in the same column will be always visible in the UI in WPF platform.

 

Link:https://help.syncfusion.com/wpf/sfkanban/swimlane?cs-save-lang=1&cs-lang=csharp&_ga=2.215516693.384410096.1566204139-108622120.1562938958

 

Xamarin Implementation:

 

You no need to define the SwinlaneKey explicitly if you expect to show more than one category in the same column. You can use the Categories property to show multiple category in one column. In Xamarin. The multiple categories which is defined in the same column will be visible in the UI only while card drag hovering.

 

Link:https://help.syncfusion.com/xamarin/sfkanban/column#multiple-category-for-a-column

 

Moreover, the documentation provided in both the platform (WPF and Xamarin) seems correct as per the implementation. Please let us know if you need further assistance on this.

 

Regards,

Lakshmi R.

 


Loader.
Live Chat Icon For mobile
Up arrow icon