How do you bind on an edit form?

2 posts, 0 answers
  1. Myles
    Myles avatar
    18 posts
    Member since:
    Mar 2012

    Posted 14 Feb 2013 Link to this post

    I have an edit view for a particular model.  The view contains the following Kendo autocomplete control code:

     @(Html.Kendo().AutoCompleteFor(model => model.Location).Placeholder("Please select a value")
                   .DataTextField("Name")) //Specifies which property of the Product to be used by the autocomplete.

    The drop down auto complete is working.  However, existing values on the model (Location property) are not bound to the control.  When I open up an existing record in edit mode the autocomplete control is empty, even if the underlying Location property on the model has a value.  How does this control handle binding?
  2. Daniel
    Daniel avatar
    2110 posts

    Posted 18 Feb 2013 Link to this post


    The name is overridden with the Name method so the value will not be bound to a field named Location but locationAutoComplete. Removing the name should resolve the problem.

    Kind regards,
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
Back to Top