multiselect ajax and displaying selected values

5 posts, 1 answers
  1. William Dunn
    William Dunn avatar
    15 posts
    Member since:
    May 2010

    Posted 12 Apr 2013 Link to this post

    I have an ajax multiselect with autobind of false.  When returning to the page I would like my selected value(s) to display when the page loads, but they currently do not display until I click in the mulitselect.

    Is there anything I can do to make this happen? 

    I've attached a sample project.
    @(Html.Kendo().MultiSelectFor(x => x.ReportOwner)
        .DataTextField("Name")
        .DataValueField("Pid")
        .DataSource(dataSource => dataSource
            .Read(read => read.Action("_RelatedEmployees", "AdvancedSearch"))
            .ServerFiltering(false)
            .Events(events => events.Error("onError"))
        )
        .AutoBind(false)
        .Placeholder("Select report owners...")
    )
  2. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 15 Apr 2013 Link to this post

    Hello William,

     
    The desired functionality is available in the the last internal build (2013.1.411). You will need to pass the selected data items (not just the values) to the Value method of the wrapper:

    @(Html.Kendo().MultiSelectFor(x => x.ReportOwner)
        .DataTextField("Name")
        .DataValueField("Pid")
        .DataSource(dataSource => dataSource
            .Read(read => read.Action("_RelatedEmployees", "AdvancedSearch"))
            .ServerFiltering(false)
            .Events(events => events.Error("onError"))
        )
        .AutoBind(false)
        .Placeholder("Select report owners...")
        .Value(List<[your model]>)
    )

    Regards,
    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. UI for ASP.NET MVC is VS 2017 Ready
  4. William Dunn
    William Dunn avatar
    15 posts
    Member since:
    May 2010

    Posted 15 Apr 2013 Link to this post

    Much appreciated... Thank You.
  5. William Dunn
    William Dunn avatar
    15 posts
    Member since:
    May 2010

    Posted 29 May 2013 Link to this post

    I have finally got around to implementing this with the latest version of Kendo.

    When I return to the page the previously selected items do appear.

    When I click on the multiselect it does not call the read method again to give me the other values to select.

    I have attached a sample project.

    thanks
  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 31 May 2013 Link to this post

    Hello William,

     
    Currently, this is not supported. The serverFiltering needs to be true and the end user should type something in the input in order to initiate filtering.

    We will improve current behavior in the next internal build due the next week.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready