0

I use a Listpicker in a Listbox inside a ScrollViewer. If the number of items in the Listpicker is 3 (or less than 3), the Listpicker opens as a ComboBox in the current page. But if the number of items is more than 3, it opens in another page, not as a ComboBox. How can I solve this problem?

Abbas
  • 14,186
  • 6
  • 41
  • 72
Ceyhun Rehimov
  • 111
  • 2
  • 11

4 Answers4

1

You can set number of items that as displayed on an other page by setting ItemCountThreshold property of ListPicker. Eg. setting ItemCountThreshold=3 will force ListPicker to show items on new page when there are more then 3 items available to select.

More info about ListPicker properties can be fount eg. here: ListPicker for WP7 in depth

MarcinJuraszek
  • 124,003
  • 15
  • 196
  • 263
0

While the toolkit team advised to adhere to the restriction, there are workarounds for this issue. A value can be set via code and also via a binding.

<toolkit:ListPicker ItemCountThreshold="{Binding Hugo,FallbackValue=10}">(...)
<!-- Hugo is a bogus binding that does not really exist -->

See my detailed answer to a related question.

Community
  • 1
  • 1
Markus Bruckner
  • 2,852
  • 2
  • 24
  • 29
0

ListPicker is a new control in the Silverlight Toolkit for Windows Phone. It is for user's to choose another item like Combobox but ListPicker has more features than a Combobox. When you have little item about 1->4 it'll show data as a Combobox and if more item Listpicker will show data as a ListBox.

Refer this Link to get perfect idea.

Yoko Zunna
  • 1,804
  • 14
  • 21
0

Read this article and certainly pay attention to the "ItemCountThreshold" property.

ItemCountThreshold is a dependency property of type int. It specifies the maximum number of items that will be displayed in Expanded mode. By default, lists with five or fewer items expand in-place while lists with more items switch to a full-screen selection interface. It can also be set to 0 to switch Full mode or a very large number to switch Expanded mode.

Abbas
  • 14,186
  • 6
  • 41
  • 72