I am using a Telerik MVC grid, which is bound to a model object.
For one of the Model's properties, I would like to use a Telerik Autocomplete control.
This works fine for inserting a data row, the Insert form is displayed correctly, and when I start typing in the textbox generated by the Autocomplete control, the options I have set appear fine, and I can select one. Clicking save saves the selected string correctly.
The problem I have is on an Edit of an existing data row.
As soon as I click Edit, it crashes out into Telerik.Grid.Editing.min.js on:
this.evaluate=function(r,u){varq=r,s=false,w=u.split(".")
...saying that "u is undefined".
My EditTemplate looks like this:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<string>" %><scripttype="text/javascript">function onAutoCompleteDataBinding(e) {var autocomplete = $('#City').data('tAutoComplete');autocomplete.dataBind(["Chicago", "New York"], true);}</script><%= Html.Telerik().AutoCompleteFor(a => a).Name("City").ClientEvents(events => events.OnDataBinding("onAutoCompleteDataBinding"))%>
I've tried registering the javascript files manually as per http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-required-javascript-files.html but it hasn't helped.
I am also aware of the JQuery UI Autocomplete, but I can't get it to
work within the Telerik MVC grid, it's on the backburner for now.
I'm using Telerik MVC v.2010.2.930 and JQuery 1.4.2
Can anyone help?