Hi Everybody,
I am trying to bind the kendoui grid using a method on my code behind page (i.e c# page)
My aspx page content is like beow:
In the below code block the portion that is marked in bold is the place were we specify data source for the grid.
My doubt is, how do i bind this grid by calling a method (that return a json or string) in my code behind page,
without using webservices.
how do i specify a c# method as datasource, and what possible values can that function return.
<div id="example" class="k-content">
<div id="grid">
</div>
<script>
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
transport: {
read: { url:"testgrid.aspx/LoadData",
dataType: "string"}
},
schema: {
model: {
fields: {
Age: { type: "number" },
Name: { type: "string" }
}
}
},
pageSize: 10,
serverPaging: true,
serverFiltering: true,
serverSorting: true
},
height: 250,
filterable: true,
sortable: true,
pageable: true,
columns: [{
field:"Age",
filterable: false
},
"Name"
]
});
});
</script>
</div>
Any one please give a suggestion to bind the kendo grid using code behind(c#) methods.
I am using visual studio 2008 and .net framework 3.5.
Thank You,
I am trying to bind the kendoui grid using a method on my code behind page (i.e c# page)
My aspx page content is like beow:
In the below code block the portion that is marked in bold is the place were we specify data source for the grid.
My doubt is, how do i bind this grid by calling a method (that return a json or string) in my code behind page,
without using webservices.
how do i specify a c# method as datasource, and what possible values can that function return.
<div id="example" class="k-content">
<div id="grid">
</div>
<script>
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
transport: {
read: { url:"testgrid.aspx/LoadData",
dataType: "string"}
},
schema: {
model: {
fields: {
Age: { type: "number" },
Name: { type: "string" }
}
}
},
pageSize: 10,
serverPaging: true,
serverFiltering: true,
serverSorting: true
},
height: 250,
filterable: true,
sortable: true,
pageable: true,
columns: [{
field:"Age",
filterable: false
},
"Name"
]
});
});
</script>
</div>
Any one please give a suggestion to bind the kendo grid using code behind(c#) methods.
I am using visual studio 2008 and .net framework 3.5.
Thank You,