locked
Using IBehavior in Behavior SDK on multiple selection ListView for selectedItems

    Question

  • Hi,

    I want to binding selectedItems on multiple selection ListView, default ListView not allow do that so I use IBehavior in Behavior SDK to implement a custom behavior.

    The project link here: http://1drv.ms/1HeOVPo

    When running app, symptom is the selectedItems be binded but Listview not update selected items status on UI.

    Any ideas?

    Sincerely,

    Vu


    Vu Tran

    Saturday, March 21, 2015 2:42 PM

Answers

  • Hi Herro Wong,

    I'm investigating the issue. BTW, I found way to work-around. Like this: 

    private void MultiChoiceValues_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
    {
        ListViewItem _item = args.ItemContainer as ListViewItem;
        ....
        // Check conditions
        ....
        _item.IsSelected = true; // update item selected status
    }

    Cheers,

    Vu


    Vu Tran

    Tuesday, March 24, 2015 3:31 PM

All replies

  • Hi Vu,

    Based on my knowledge, you’ve not provided the code snippet to apply the selected items to ListView control using the MultiSelectBehavior. Although I am not familiar with this SDK, I think this SDK just set the SelectedItems to ListView, but not check to make items be selected. Maybe this is the problem.

    To work around it, I suggest you change to use an easy way for binding. This reference shows you how to. http://stackoverflow.com/questions/26345820/binding-selecteditems-in-listview-to-a-viewmodel-in-windows-phone-8-1.  Please try and let me know the result.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 23, 2015 3:40 AM
    Moderator
  • Hi Herro Wong,

    I'm investigating the issue. BTW, I found way to work-around. Like this: 

    private void MultiChoiceValues_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
    {
        ListViewItem _item = args.ItemContainer as ListViewItem;
        ....
        // Check conditions
        ....
        _item.IsSelected = true; // update item selected status
    }

    Cheers,

    Vu


    Vu Tran

    Tuesday, March 24, 2015 3:31 PM