Hi,
I am unable to bind the kendo grid with the Json data which returns a list of items.
following is my controller code :
Function Display(<DataSourceRequest> request As DataSourceRequest) As ActionResult
Dim l As List(Of ServiceReference1.Cust_Detail) = New List(Of ServiceReference1.Cust_Detail)
Dim d As New ServiceReference1.Service1Client()
l = d.Display()
Return Json(l.ToDataSourceResult(request), JsonRequestBehavior.AllowGet)
End Function
Following is my View code :-
@Code
Html.Kendo().Grid(Of Test_MVC_kendo.Cust_Detail)() _
.Name("Grid") _
.Columns(Sub(c)
c.Bound(Function(p) p.Cust_ID)
c.Bound(Function(p) p.Cust_Name)
c.Bound(Function(p) p.Cust_City)
c.Bound(Function(p) p.Cust_Age)
End Sub) _
.Sortable() _
.Filterable() _
.Events(Function(e) e.DataBound("onDataBound")) _
.DataSource(Sub(d)
d.Ajax().Read(Function(read) read.Action("Show", "Customer")).Model(Sub(m)
m.Id(Function(i) i.Cust_ID)
End Sub) _
.Read(Function(read) read.Url("api/Customer").Type(HttpVerbs.Get)) _
.Create(Function(create) create.Url("api/Customer").Type(HttpVerbs.Post)) _
.Update(Function(update) update.Url("api/Customer").Type(HttpVerbs.Put)) _
.Destroy(Function(destroy) destroy.Url("api/Customer").Type(HttpVerbs.Delete))
End Sub) _
.Render()
End Code
Following is my Model class :-
Public Class Cust_Detail
<Required>
<Range(1, 10)>
Public Property Cust_ID As String
<Required>
Public Property Cust_Name As String
<Required>
Public Property Cust_Age As String
<Required>
Public Property Cust_City As String
End Class
Could anyone guide me please ,why i am unable to see the kendo grid bindinded