Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7402305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:42:43+00:00 2026-05-29T04:42:43+00:00

I have just started trying to build my first wp7 app, and I am

  • 0

I have just started trying to build my first wp7 app, and I am learning c# and xaml from scratch.
I have made good progress but I am having trouble with the silverlight toolkit listpicker.

I databound a list picker using the following template

        </DataTemplate>
        <DataTemplate x:Name="pitVolume">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Litres}"  Margin="12 0 0 0"/>
            </StackPanel>
        </DataTemplate>

bound to this:
List concunitsource = new List();

            concunitsource.Add(new Units() { Molar = "pM", Factor = -12});
            concunitsource.Add(new Units() { Molar = "nM", Factor = -9, Grams = "ng"});
            concunitsource.Add(new Units() { Molar = "µM", Factor = -6, Grams = "µg", Litres = "µL" });
            concunitsource.Add(new Units() { Molar = "mM", Factor = -3, Grams = "mg", Litres = "mL" });
            concunitsource.Add(new Units() { Molar = "M", Factor = 0, Grams = "g", Litres = "L" });

The listpicker binds but I get two small blank but selectable entries at the top (presumably space for pico and nano litres). I left these out as they would not get used by the user.
Is there anyway to prevent this, and just show the 3 that I want?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:42:45+00:00Added an answer on May 29, 2026 at 4:42 am

    I can think of a few ways but there are probably more:

    The simplest would be to not load items in the ListPicker that won’t be displayed. Or use Linq-to-Objects to filter out the items you want displayed to the collection that is bound to the control.

    dspConcunitsource = concunitsource.Where(u => u.Litres != null).ToList();
    

    You might look at using a CollectionViewSource to filter out items in the collection you don’t want displayed based on some criteria.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started learning Rails and I'm trying to build a post/like type
I have just started learning Jquery and am new to writing javascript (I am
I am just getting started with symfony and am trying to build the database
Just started learning mvc3. I've built a fairly basic website (also using EF-Code-First if
I have just started trying to learn Git and I have got a little
Hi I have just started working with Highstock's javascript charts and was trying to
I have just started making a test app , here is what happened. I
I have just started reading Modern C++ Design Generic programming and Design Patterns Applied
i have just started playing aorund with asp.net mvc and i want to view
We have just started out with Team Foundation Server 2008 / Visual Studio Team

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.