1
List<Items> list = new List<Items>();

        list = (from query in doc.Descendants("row")
                   select new Items
                   {
                       Id = Convert.ToInt64(query.Element("Id").Value),
                       Name = query.Element("Name").Value,
                       title = query.Element("title").Value
                   }).ToList();

        listPicker1.DataContext = list;    

Is it possible to show by default "Select" in windows phone list picker and whenever I select list picker item, the item should be display.

Here is the code I have so far:

<toolkit:ListPicker ItemsSource="{Binding}" x:Name="listPicker1" FullModeHeader="Employee" SelectionChanged="ListPicker1_SelectionChanged" BorderThickness="0" Margin="130,-45,144,160" SelectedItem="{Binding}" SelectionMode="Single" ExpansionMode="FullScreenOnly" Header="" CacheMode="BitmapCache" Height="55" Background="White">
    <toolkit:ListPicker.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Name}" TextWrapping="Wrap" FontSize="22" Width="200" Height="50" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" Foreground="Blue"/>
            </StackPanel>
        </DataTemplate>
    </toolkit:ListPicker.ItemTemplate>

    <toolkit:ListPicker.FullModeItemTemplate>

        <DataTemplate>



                <StackPanel Orientation="Vertical">
                    <TextBlock Text="{Binding Name}" Margin="10" FontSize="24" TextWrapping="Wrap" Foreground="Black" Width="440"/>
                    <TextBlock Text="{Binding title}" FontSize="20" TextWrapping="Wrap" Foreground="Black" Width="440"/>
                </StackPanel>

        </DataTemplate>

    </toolkit:ListPicker.FullModeItemTemplate>

</toolkit:ListPicker>

1 Answer 1

1

To make this add a item named "select" and set it as default.

6
  • 1
    thanks bro for reply but my items source is coming from class, not manual, it is binded with "{Binding}"
    – Viraj Shah
    Apr 7, 2014 at 6:39
  • whatever may be the source,fetch it from your class and manage the states in your Object. Apr 7, 2014 at 6:46
  • my list picker items come as a web service response, so how to solve? thanks!
    – Viraj Shah
    Apr 7, 2014 at 6:51
  • add it in your webservice! Apr 7, 2014 at 6:52
  • I can't, because I have not created web service, I just call the method, it is created in java.
    – Viraj Shah
    Apr 7, 2014 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.