BSBuvana Sathasivam Syncfusion Team October 5, 2016 01:18 PM UTC
Hi Anubischiang ,
Thanks for your update.
We cannot load directly from Data source. You need to define columns collection with “headerText” and “key” properties.
“keyField” - Map the data source column name to use as key value for each column. “key” - Use as mapping value for each column. For e.g. if key is ‘Open’ , then cards with value ‘Open’ will be displayed under that particular column. “headerText” - Use as heading for each column.
So we suggest you to follow the below steps to bind dynamic columns to Kanban column collection.
1.Create your datasource with two keys. one for headertext and one for mapping key. Use default values 'headerText','key' will be bind with columnsor other values. For example, here we used columnTextand columnkey.
2.columnText-Use as heading to each column.columnKey-Used as mapping value for each column.E.g. if key is ‘Open’ , then cards with value ‘Open’will display under particular column..
3.Send the formatted data to view page using view bag like below.
4. Set the column data (sent from controller) to columns array collection. If you received default collection (with naming headerText and key), the data will directly assigned to columns array collection. Else, it will format to headerText and key format and assigned to columns array collection.