I have kendo grid which has one string column that is using an autocomplete editortemplate. Now when the user first selects something from the list the text reads [object Object]. If the user does the selection again it shows up right. The editortemplate gets its values as an list of custom objects and uses one of the properties in that object. I've tried to override the ToString method of the object but alas it still returns the [object Object] on first selection.
This same behaviour is present when using webcombo as editortemplate.
Anyone seen this behaviour before and how to fix it. I cannot reproduce it on any of the demos here so it has to do something with the setup my project is using.
The code of the column binding:
And the template ("Handlers.cshtml"):
@(Html.Kendo().AutoComplete()
.Filter(FilterType.StartsWith)
.IgnoreCase(false)
.Suggest(true)
.Name("Person")
.DataTextField("Name")
.MinLength(1)
.Template("#=Name#")
.DataSource(source => { source.Read(read =>
{
read.Data("GetQueryStringData").Action("GetHandlersTemplate", "AHJ").Type(HttpVerbs.Post);
});
})
)
Using mvc razor
This same behaviour is present when using webcombo as editortemplate.
Anyone seen this behaviour before and how to fix it. I cannot reproduce it on any of the demos here so it has to do something with the setup my project is using.
The code of the column binding:
columns.Bound(o => o.Person).EditorTemplateName("Handlers");
And the template ("Handlers.cshtml"):
@(Html.Kendo().AutoComplete()
.Filter(FilterType.StartsWith)
.IgnoreCase(false)
.Suggest(true)
.Name("Person")
.DataTextField("Name")
.MinLength(1)
.Template("#=Name#")
.DataSource(source => { source.Read(read =>
{
read.Data("GetQueryStringData").Action("GetHandlersTemplate", "AHJ").Type(HttpVerbs.Post);
});
})
)
Using mvc razor