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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding Columns using XAML

Thread ID:

Created:

Updated:

Platform:

Replies:

128564 Jan 29,2017 09:51 PM UTC May 2,2018 12:17 PM UTC Xamarin.Forms 13
loading
Tags: SfKanban
Jason
Asked On January 29, 2017 09:51 PM UTC

How can I bind to columns using XAML?

I need to be able to bind to columns, as we have custom columns created i.e. setup.

Jason
Replied On January 29, 2017 09:59 PM UTC

Also how do I bind the categories for a column in XAML?

Saravana Pandian Murugan [Syncfusion]
Replied On January 31, 2017 01:59 PM UTC

Hi Jason,

We have prepared a sample based on your requirement. Please download the sample from following location.

Sample : http://www.syncfusion.com/downloads/support/forum/128564/ze/KanbanSample623606980  

Regards,
Saravana Pandian M. 


Jason
Replied On January 31, 2017 07:15 PM UTC

Hi there, thank you for your efforts, although the column is still being defined in the XAML code, so this shows how to bind the categories, but what if I have 5 columns or ten columns?

I did manage to find a workaround, although this meant using the code behind file to do the actual column generation...

        public void CreateColumns(List<tngBoardColumn> cols)
        {
            kanban.Columns.Clear();
            kanban.Columns.Add(new Syncfusion.SfKanban.XForms.KanbanColumn()
            {
                Title = "Open",
                Categories = new List<object>() { "Open" }
            });
            foreach (var col in cols)
            {
                kanban.Columns.Add(new Syncfusion.SfKanban.XForms.KanbanColumn()
                {
                    Title = col.Name,
                    Categories = new List<object>() { col.Name.Replace(" ", string.Empty)}
                });
            }
        }
  


But it would have been nice to do all of this from the viewmodel or by ...

<kanban:SfKanbanColumns ItemsSource="{Binding ColumnsinVM}" />

Parthiban Sundaram [Syncfusion]
Replied On February 1, 2017 01:05 PM UTC

Hi Jason,

Thanks for the update.

We have prepared the sample based on your requirement. Please download the sample from following location.

Code snippet:

 
<kanban:SfKanban Columns="{Binding KanbanColumns}"/> 

We have also prepared a sample based for this. Please download the sample from following location.

Sample: http://www.syncfusion.com/downloads/support/forum/128564/ze/KanbanSample1221341936  

Please let me know, if you need further assistance.

Regards,
Parthiban S
 


Jason
Replied On April 3, 2017 08:07 PM UTC

There is an issue with Kanban on IOS and Android to do with custom columns implemented in the code behind. This issue however is not in UWP, tested in both WP10 and Windows 10 Device.

If the columns are created as suggested below, and the cards are created and added to the board, only items with a Category of "Open" are added, any other column created, the cards are not shown in the correct column based on their Category?

If I add  a total of 20 cards and 10 of them are Category "Open" then I see 10 cards in the Open category and no others, I have checked and rechecked the category entries to ensure they match and they are correct.

In fact you can drag a card from the open category to another category then flip the device, making a redraw and the cards that were dragged to the new category disappear!

I am not sure but this seems a bit like the bug in kanban reported here in the javascript forum...

https://www.syncfusion.com/forums/129693/knockout-support



Divya Venkatesan [Syncfusion]
Replied On April 4, 2017 04:22 PM UTC

Hi Jason,

We are not able to reproduce the reported issue at our end and we have prepared a sample for this. Please download the sample from following location.

Sample: http://www.syncfusion.com/downloads/support/forum/128564/ze/Kanban-1551094782

Please update us the modified sample to reproduce the issue which will be helpful for providing further assistance on this.

Regards,
Divya Venkatesan

Jason
Replied On April 8, 2017 09:35 PM UTC

I cannot fault your test app, but for the life of me I cannot find what is wrong with my app at all, can I upload my app to you for you to look at it, there is no reason I can find that should prevent this from working, yet it doesn't?

Jason
Replied On April 8, 2017 11:58 PM UTC

I am really pulling my hair out now......

//Add Data to a local List<>
_columns = new List<ColModel>();
_columns.Add(new ColModel() { Name = "Open", Category = "Open" });
_columns.Add(new ColModel() { Name  = "In Progress", Category = "EBED51D0-FA68-49C6-830D-EE72B30E7BA0"});
_columns.Add(new ColModel() { Name = "Code Review", Category = "AF48DAC5-2855-46FF-A511-9E86E7FABE09"});
_columns.Add(new ColModel() { Name = "Done", Category = "45064E8E-6F88-459D-BA74-B8721F1E15C8" });


//Load Data from a sqlite db
var cols = Task.Run(async () => await _database.BoardColumn().GetProjectColumns(SelectedProject.ProjectId)).Result;

//Add the db columns
KanbanColumns = new KanbanColumnCollection();
foreach (var col in cols)
{
  string s = col.BoardColumnId;
  KanbanColumns.Add(new KanbanColumn() { Categories = new List<object>() { s }, Title = col.Name });
}

//Add the Local List data
foreach (var col in _columns)
{
  string s = col.Category;
  KanbanColumns.Add(new KanbanColumn() { Categories = new List<object>() { s }, Title = col.Name });
}


With all this said and done...
 cards added to the columns made from the Local List (i.e. Compiled into the App) work, 
   cards added to a column loaded from a sqlite db table do not work, I have checked the data and the ids match fine, if I debug the app and examine the ids from the db and from the static list, they match correctly?

When sfKanBan columns match their cards, are you using an IndexOf() to find the categories? I wonder if there is some weird locale setting getting in the way, with the GUID?

Jason
Replied On April 9, 2017 01:15 AM UTC

OK I managed to make an example showing that if the data is loaded from a db table it doesn't link to the cards, can you check this out and let me know what might be wrong?
Attachment: Kanban1551094782_(2)_6dac8432.zip

Jason
Replied On April 11, 2017 10:54 PM UTC

Any news on this, can you reproduce this issue at your end?

Divya Venkatesan [Syncfusion]
Replied On April 13, 2017 12:19 PM UTC

 Hi Jason,

We have created a new incident 177204 under your account to track the status of this query. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

Please let us know, if you have any query.

Regards,
Divya Venkatesan
 


Emil
Replied On May 1, 2018 10:35 PM UTC

Hello, 

I am having this problem also. can you please update me with the solution as well?

thanks,

Emil

Rachel A [Syncfusion]
Replied On May 2, 2018 12:17 PM UTC

Hi Emil, 

Thanks for contacting Syncfusion Support. 

We have resolved the binding issue in the 15.2.0.40 version . Please upgrade to the latest version. 

Also , we have prepared sample for your reference. Please find the sample in the below location. 


If you still face any problem, please revert to us by modifying the sample which will be helpful to proceed further. 

Thanks, 
Rachel. A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;