How to bind the SelectedItems of a ListView to a ViewModel?

2 posts, 0 answers
  1. fbaptiste
    fbaptiste avatar
    19 posts
    Member since:
    Apr 2007

    Posted 26 Jan 2015 Link to this post

    I am using the following List view MVVM sample as the base for my code, but am trying to combine it with the selection feature of the ListView. 

    One thing i could not achieve is the binding of the SelectedItems to an array in the ViewModel. i could kind of "hack" through this programmatically via the change event, but that's not enough for scenarios where i'd like certain items to be selected on loading of the widget. so i'm looking for a "right" way to this and to bind the selected items of the listview to a view model.

    Can you provide an example for doing this?

    Thank you.
  2. Alexander Valchev
    Alexander Valchev avatar
    2873 posts

    Posted 28 Jan 2015 Link to this post


    The functionality that you are looking for is not supported out of the box by the ListView/MVVM components.
    It is possible to achieve it but you will have to write custom binding that will handle the selection of the values and the update of the ViewModel. This help article explains how to create a custom Kendo MVVM binding:
    I hope this information will help.

    Alexander Valchev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top