or
$(document).ready(function() { dataSource = new kendo.data.DataSource({ transport: { read: {url:"<?=base_url()?>/bank"}, create: {url:"<?=base_url()?>/bank/create",type:"POST"}, update: {url:"<?=base_url()?>/bank/update", type:"POST"}, destroy: {url:"<?=base_url()?>/bank/destroy",type:"POST"}, }, batch: true, pageSize: 25, schema: { model: { id: "id_bank", fields: { nama_bank: { type: "string" }, } } } }); //kendo grid $("#grid_bank").kendoGrid({ dataSource: dataSource, editable: "popup", height: 450, filterable: true, sortable: true, pageable: true, toolbar: ["create"], columns: [ { field: "nama_bank",title: "Nama", filterable: true }, { command: ["edit", "destroy"], title: " ", width: "160px" } ] });});using System;using System.Collections.Generic;using System.Linq;using System.Web.Services;namespace WebApplication3{ public partial class _default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [WebMethod] public static IEnumerable<Comuni> ListaComuni() { using (var northwind = new DataClasses1DataContext()) { var lista = northwind.CAPCOM.Where(row=> row.CapComId<100) // Use a view model to avoid serializing internal Entity Framework properties as JSON .Select(p => new Comuni() { CapComId = p.CapComId, CapComCod = p.CapComCod, CapComCom = p.CapComCom }) .ToList(); return lista; } } public class Comuni { public int CapComId { get; set; } public string CapComCod { get; set; } public string CapComCom { get; set; } public int Total { get; set; } } }}[{"Active":true,"DisplayText":"Flyers","TemplateCategoryID":1},{"Active":true,"DisplayText":"Door Hangers","TemplateCategoryID":2},{"Active":true,"DisplayText":"Postcards","TemplateCategoryID":3},{"Active":true,"DisplayText":"Tri-Fold","TemplateCategoryID":4},{"Active":true,"DisplayText":"Facebook Graphics","TemplateCategoryID":5}]@(Html.Kendo().ComboBox() .Name("templateCat") //The name of the combobox is mandatory. It specifies the "id" attribute of the widget. .DataTextField("DisplayText") //Specifies which property of the Product to be used by the combobox as a text. .DataValueField("TemplateCategoryID") //Specifies which property of the Product to be used by the combobox as a value. .Filter(FilterType.Contains) .DataSource(source => { source.Read(read => { read.Action("GetTemplateCategories", "Console"); //Set the Action and Controller name }); }) .SelectedIndex(0) //Select first item.)public ActionResult GetTemplateCategories(){ string baseAddress = string.Format(ConfigurationManager.AppSettings["MarketingServiceAddress"] + "GetTemplateCategories"); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(baseAddress); request.Method = "GET"; request.ContentType = "text/plain"; using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { int statusCode = (int)response.StatusCode; StreamReader reader = new StreamReader(response.GetResponseStream()); string results = reader.ReadToEnd(); return Json(results, JsonRequestBehavior.AllowGet); }}