This is a migrated thread and some comments may be shown as answers.

[Solved] how to bind the grid using knockoutjs

0 Answers 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Somogyi
Top achievements
Rank 1
Somogyi asked on 16 Mar 2012, 03:45 PM
Hello,

I would like to use knockoutjs to bind my grid. How could I do that?

 I tried the following, without any success:

@Code
    ViewBag.Title = "TodoItems"
    Layout = "~/Views/Shared/_SpaLayout.vbhtml"
     
    Dim myDict As Dictionary(Of String, Object) = New Dictionary(Of String, Object)
    myDict.Add("data-bind", "value: todoItems()")
End Code
 
 
@(Html.Telerik().Grid(Of tempproject.Models.TodoItem).Name("MyGrid").HtmlAttributes(myDict)
    )
 
@(Html.UpshotContext(bufferChanges:=True) _
      .DataSource(Of tempproject.tempproject.todonewController)(Function(x) x.GetTodoItems()) _
      .ClientMapping(Of tempproject.Models.TodoItem)("TodoItem"))
 
<script type="text/javascript">
    ko.applyBindings(new TodoItemsViewModel());  
</script>


Thank you,
Csaba
Tags
Grid
Asked by
Somogyi
Top achievements
Rank 1
Share this question
or