2
votes

I use ListPicker from Silverlight Toolkit for WP August 2011 as below but it doesn't work

        <controls:PanoramaItem Header="settings">
                <toolkit:ListPicker>
                    <toolkit:ListPickerItem Content="5" />
                    <toolkit:ListPickerItem Content="10" />
                    <toolkit:ListPickerItem Content="15" />
                    <toolkit:ListPickerItem Content="20" />
                    <toolkit:ListPickerItem Content="25" />
                    <toolkit:ListPickerItem Content="30" />
                </toolkit:ListPicker>
        </controls:PanoramaItem>

Tried to replace by ListPicker from Silverlight Toolkit for WP February 2011 but it has same problem.

But I can use ListPicker from Silverlight Toolkit for WP February 2011 on an app which used SDK v7.0. Seems the problem causes by SDK v7.1

Found the reason! It's because ListPicker only can contain 5 or less than 5 items. If the list contains more than 5 items, using ListBox instead.

2
If you want to answer your own question then add it as an answer, not part of the questionMatt Lacey
StackOverflow doesn't allow me to answer my own question if it's the first post. Sound funny!Agile Hobo
Sorry, didn't notice the rep issue. Hopefulyl you'll stick around, earn som emore rep and avoid such limitations in the future. Welcome to SO.Matt Lacey

2 Answers

0
votes

If you're running into a limit when the number of items is greater than 5 be sure you have set the ItemCountThreshold as this restricts the number of items you can have in a the control in the standard view. The default value for this is 5 so increasing it to 6 should address your issue.

See also:
http://silverlight.codeplex.com/workitem/9412
and
http://blogs.msdn.com/b/delay/archive/2010/11/03/listpicker-i-hardly-even-know-er-a-detailed-overview-of-the-windows-phone-toolkit-s-listpicker-control.aspx

0
votes

I just used the ListPicker from the August 2011 version of the SLWP7 toolkit with seven items, so I don't think your hard limit of 5 is correct in general, though it might be specific to being in a panorama item. When you say it doesn't work, do you mean nothing happens when you try to use it (ie doesn't register the Tap event), or doesn't display at all?

One caveat to note is that you can't use ListPicker within a Scrollviewer - this is a known issue with the Aug 2011 version of the SL toolkit (see http://silverlight.codeplex.com/workitem/9379) There are a few workarounds to this that i havent tried, mainly to do with changing the Tap event handler: http://forums.create.msdn.com/forums/t/90708.aspx and http://attowares.com/blog/2011/08/23/listpicker-inside-scrollviewer-wp7-toolkit-mango/ There might be something with the Panorama Item that is affecting the ListPicker in the same way...

But my main point is that you can use ListPicker with more than 5 items.