ListPicker Multiselect always selects first item

5 posts, 0 answers
  1. Mike
    Mike avatar
    13 posts
    Member since:
    Dec 2010

    Posted 05 Jul 2012 Link to this post

    I pulled my hair out for an hour thinking it was my code, looked through the documentation, and finally found a reference to some obscure "feature" of the ListPicker where it always selects the first item http://www.telerik.com/community/forums/windows-phone/listpicker/setting-radlistpicker-itemssource-causes-selectionchanged-to-fire-with-index-set-to-0.aspx

    That post is also wrong, RadListPicker does support null selection in Multiselect mode.

    Regardless, here's my issue.  Change the following two lines of code in your sample for ListPicker Multiselect.xaml.cs:

    this.categoryListPicker.SelectedItems.Add(categoryItemsSource[0]);

    this.categoryListPicker.SelectedItems.Add(categoryItemsSource[1]);

    Make them this

     

    this.categoryListPicker.SelectedItems.Add(categoryItemsSource[1]);

    this.categoryListPicker.SelectedItems.Add(categorytemsSource[2]); 

    Now explain why your simple sample app selects three items when you havigate to the page.  ListPicker always selects ItemsSource[0].  It also for some reason calls the SummaryForSelectedItemsDelegate twice on initialization.  Just step your sample code.

     

  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 05 Jul 2012 Link to this post

    Hello Мiке,

    The forum post below you refer to was created *before* the ListPicker support multiple selection and of time was writing was correct.

    I checked the scenario you described and could not reproduce the issue you are reporting - the category list picker has two values selected.

    I did however reproduced the fact that the summary delegate is called twice - we will investigate this further.

    Can you please tell us what version of the assemblies you are using and if possible a sample project that we can investigate.

    Regards,
    Valentin.Stoychev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Mike
    Mike avatar
    13 posts
    Member since:
    Dec 2010

    Posted 05 Jul 2012 Link to this post

    I am using 2012.2.0607.2040 Telerik.Windows.Controls.Input.dll

    I experienced this issue in my app, so I investigated and am able to recreate the problem in ExamplesCS_WP Multiselect.xaml.cs.

    By changing the index of the items added to the categoryListPicker.SelectedItems to not include index 0, the control will automatically add index 0.

    I've attached screen shots of the code changes and the app running with index 0 selected.



  5. Mike
    Mike avatar
    13 posts
    Member since:
    Dec 2010

    Posted 05 Jul 2012 Link to this post

    I updated to 2012.2.629.2040 and the issue no longer exists in your sample or in my application.  I'm sure if you investigate with version 2012.2.0607.2040 you will see the bug.

    The SummaryDelegate is still called twice.
  6. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 06 Jul 2012 Link to this post

    Hello Mike,

    Thanks for the update. Yes, we will investigate the issue with the double calls to the summary delegate.

    Please let us know if we can help with anything else.

    Greetings,
    Valentin.Stoychev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner