New to Telerik UI for ASP.NET MVC? Start a free 30-day trial
Data Binding
The TaskBoard provides options for binding it to local and remote data.
Binding to Local Data
Local data is the data that is available on the client when the TaskBoard is initialized.
The following example demonstrates how to bind the TaskBoard data saved in the ViewData.
Razor
@(Html.Kendo().TaskBoard()
.Name("taskBoard")
.Columns(c =>
{
c.Add().Text("To-do").Status("todo");
c.Add().Text("In Progress").Status("inProgress");
c.Add().Text("Done").Status("done");
})
.DataDescriptionField("Description")
.DataStatusField("Status")
.DataTitleField("Title")
.DataOrderField("Order")
.BindTo((IEnumerable<Kendo.Mvc.Examples.Models.TaskBoard.CardViewModel>)ViewBag.Cards)
)
Binding to Remote Data
You can also bind the TaskBoard to remote data. Remote data binding enables the retrieval of data from the server. For more information, refer to the DataSource Overview article.
The following example demonstrates how to enable remote binding in the TaskBoard by configuring the columns DataSource and the DataSource for the cards.
Razor
@(Html.Kendo().TaskBoard<Kendo.Mvc.Examples.Models.Scheduler.TaskViewModel, Kendo.Mvc.Examples.Models.TaskBoard.Column>()
.Name("taskBoard")
.ColumnSettings(columnSettings => columnSettings
.DataTextField("Text")
.DataStatusField("ID")
)
.Columns(dataSource => dataSource
.Ajax()
.Read("Remote_Data_Binding_Columns_Read", "TaskBoard")
)
.DataTitleField("Title")
.DataStatusField("OwnerID")
.DataDescriptionField("Description")
.DataCategoryField("ID")
.TemplateId("card-template")
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.TaskID))
.Read(read => read.Action("Remote_Data_Binding_Read", "TaskBoard"))
.Update(update => update.Action("Remote_Data_Binding_Update", "TaskBoard"))
)
.Editable(false)
)