Load value not working with Autobind(true)

2 posts, 0 answers
  1. Jérémy
    Jérémy avatar
    11 posts
    Member since:
    Dec 2013

    Posted 06 Dec 2013 Link to this post

    Hello,

    We have problems with the Multiselect: the initial values ​​don’t bind the control on loading of the component.
    RoutesSelected a list of type "DepotViewModel" defined in the datasource.
    RouteGuids is a list of Guid type.

     @(Html.Kendo().MultiSelect()                            
    .Name("RouteGuids")                             
    .DataTextField("Code")                             
    .DataValueField("Id")                             
    .Placeholder("Select route...")
    .AutoBind(true)                            
    .Filter("startswith")
    .MaxSelectedItems(8)
    .Value(Model.RoutesSelected)
    .DataSource(source => source.Read(read => read.Action("GetDepots", "Request")).ServerFiltering(false)               
    )      
    )

    Any idea?

    Thanks,
    Mathieu
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 10 Dec 2013 Link to this post

    Hello Christophe,

    Can you share with us what value is coming out of this variable:

    Model.RoutesSelected

    You can see what is serialized by inspecting the source of the page (by default ctrl + U in the browser)?

    Share with us your findings so we can advise you or if it is easier for you share a small runnable demo.

    Kind Regards,
    Petur Subev
    Telerik
    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 MVC is VS 2017 Ready
Back to Top