Combo box in windows phone 8
11,301
It is not recommended to use combobox control. Use the ListPicker Control.
Steps :
Download the nuget package from this link: https://www.nuget.org/packages/WPtoolkit/
-
Add a reference to the top of your xaml file :
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
-
Use ListPicker as shown below :
<toolkit:ListPicker Height="50" ScrollViewer.VerticalScrollBarVisibility="Auto" ItemsSource="{Binding ElementName=ConverterPage, Path=Locations}" Margin="179,129,70,434" Name="cmbCurrFrom"> <toolkit:ListPicker.ItemTemplate> <DataTemplate> <TextBlock FontSize="30" Foreground="Black" Text="{Binding Path=Location}"></TextBlock> </DataTemplate> </toolkit:ListPicker.ItemTemplate> <toolkit:ListPicker.FullModeItemTemplate> <DataTemplate> <TextBlock FontSize="30" Foreground="Black" Text="{Binding Path=Location}"></TextBlock> </DataTemplate> </toolkit:ListPicker.FullModeItemTemplate> </toolkit:ListPicker>
Author by
user2241251
Updated on June 13, 2022Comments
-
user2241251 almost 2 years
<ComboBox x:Name="c1" Margin="21,134,228,-184" BorderBrush="{x:Null}" BorderThickness="6" Background="{x:Null}" Foreground="#FFFF0017" /> List<String> source = new List<String>(); c1.ItemsSource = source; c1.SelectedIndex = 0;
I can see the items but I can't select them? and I can't scroll??? like when I add more than the size of the combo box,
it should appear a scroll? I'm coming from windows store c# and that is the way it is over there.
I want it to make it work just as a regular combobox, you click on it and it will appear a scrollable list of items that you can select... Thanks!