or
$("#autocomplete").data("kendoAutoComplete").bind("dataBound", function(event) { $(this).bind('dblclick', function(event) { // how to access the item ID of the item which was clicked? });});01.public JsonResult GetZips()02.{03. FreightEntities freight = new FreightEntities();04. var zips = freight.ZipCodes.AsQueryable();05. var city = freight.ZipCodes.AsQueryable();06. if (city != null)07. {08. zips = zips.Where(z => z.ZipID == zips);09. }10. return Json(freight.ZipCodes.Select(z => new {Zip = z.ZipID, State = z.StateID, City = z.City }), JsonRequestBehavior.AllowGet);11.}12. 13. 14. 15.public JsonResult GetCity()16.{17. FreightEntities freight = new FreightEntities();18. var state = freight.States.AsQueryable();19. var city = freight.ZipCodes.AsQueryable();20. if (state != null)21. {22. city = city.Where(s => s.StateID == state);23. }24. return Json(freight.ZipCodes.Select(s => new { State = s.StateID, City = s.City }), JsonRequestBehavior.AllowGet);25. 26.}
