Selection returns an object as text

3 posts, 0 answers
  1. Juuso
    Juuso avatar
    1 posts
    Member since:
    Mar 2012

    Posted 29 Jan 2013 Link to this post

    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:
    columns.Bound(o => o.Person).EditorTemplateName("Handlers");

    And the template ("Handlers.cshtml"):
            .DataSource(source => { source.Read(read =>
                      read.Data("GetQueryStringData").Action("GetHandlersTemplate", "AHJ").Type(HttpVerbs.Post);

    Using mvc razor
  2. Georgi Krustev
    Georgi Krustev avatar
    3724 posts

    Posted 31 Jan 2013 Link to this post

    Hello Juuso,

    I prepared a simple test project in order to replicate the issue, but to no avail. Could you please check the attached application and modify it in order to reproduce the problem ?

    All the best,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Juuso
    Juuso avatar
    1 posts
    Member since:
    Mar 2012

    Posted 31 Jan 2013 Link to this post

    Sweet, thank you!

    I tried to reproduce the issue with out any success. Then i checked the data which the controller was sending to the Template. Difference was that in my case i was sending Objects where as in your example was sending just a string list. After changing the controller function in my project it started to work just fine. 

    Tried to reproduce the issue with your project by sending whole objects but it still worked just fine. 

    All in all, my site now works as planned and this is excellent. I will probably try to reproduce the issue with your example just out of curiosity and if i can reproduce it i will let you know.

    - Juuso 
Back to Top