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

  • SEARCH
  • Home
  • 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 9263789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:40:16+00:00 2026-06-18T13:40:16+00:00

Well, well, this is my very first question in StackOverflow! I’ve been using this

  • 0

Well, well, this is my very first question in StackOverflow! I’ve been using this site since ages but I never had to ask something because I always found the answer in someone else’s question lol Apparently this is not the case anymore lol.

Anyway, I’m trying to bind a list of a custom class (that is decorated to be used with the DataContext that manages a local SQL Server CE 3.5 database – natively included in Windows Phone 7.5) to a ListPicker control from the WPToolkit and strangely I can’t see the value of the element I bound in the ListPicker (I made sure the list is populated).

Here’s the class:

[Table(Name = "Rubriques")]
class Rubrique
{
    [Column(IsPrimaryKey = true, DbType = "TINYINT", CanBeNull = false)]
    public Byte Id { get; set; }

    [Column(DbType = "NVARCHAR(40)")]
    public String Nom { get; set; }
}

Here’s the DataContext:

class IntermediaireDataContext : DataContext
{
    public IntermediaireDataContext() : base("Data Source='isostore:/IntermediaireBDD.sdf';")
    {
    }

    public Table<Rubrique> Rubriques
    {
        get { return this.GetTable<Rubrique>(); }
    }
}

Here’s the code I use to bind the list to the ListPicker:

using (IntermediaireDataContext context = new IntermediaireDataContext())
{
    rubs = (from x in context.Rubriques select x).ToList<Rubrique>(); //rubs already exists
    RubListPicker.ItemsSource = rubs;
}

Here’s the XAML:

<toolkit:ListPicker x:Name="RubListPicker" SelectionMode="Single" FullModeHeader="Rubriques">
    <toolkit:ListPicker.ItemTemplate>
        <DataTemplate>
            <StackPanel>
                <TextBlock Text="{Binding Nom}" FontSize="16"/>
            </StackPanel>
        </DataTemplate>
    </toolkit:ListPicker.ItemTemplate>
    <toolkit:ListPicker.FullModeItemTemplate>
        <DataTemplate>
            <StackPanel>
                <TextBlock Text="{Binding Nom}" FontSize="26" FontWeight="Bold"/>
            </StackPanel>
        </DataTemplate>
    </toolkit:ListPicker.FullModeItemTemplate>
</toolkit:ListPicker>

The list of Rubrique rubs gets populated and is set as ItemsSource to RubListPicker and if I remove the Text="{Binding Nom}" of the TextBlock in the DataTemplate I can see the name of the class MyNamespace.Rubrique in every element in the ListPicker.

I can’t figure out what is the problem with the data binding… Any help would be greatly appreciated 🙂

I’m using the last version of WPToolkit 4.2012.10.30 from NuGet in Visual Studio 2012 Ultimate with the Windows Phone 8 SDK.

Thanks for taking the time to read this!

Regards,

Ali


EDIT

I found the solution and it made me laugh hard lol.

I had to change de security level of my class Rubrique; When I did set it to public everything worked fine.

Actually, the ListPicker had access to the List<Rubrique> but could not access the value of each Rubrique.

A good one to remember for the future: Always check the security level of your classes/attributes/methods when using external libraries.

  • 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-06-18T13:40:18+00:00Added an answer on June 18, 2026 at 1:40 pm

    This is my first question ever in StackOverflow and I get to answer it myself: Like A Boss 😀

    So the trick was to make my class public so it can be accessed by the ListPicker control from WPToolkit 😉

    Cheers!

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

Sidebar

Related Questions

I do realize that this question seems very well known, but since I don't
This is my first question here, probably a very simple one but I can't
Sorry this is not a very well defined question, I am thinking about an
Greetings! This is my first question. I've searched all over the web as well
This is my first question on S.O. I have a very odd problem. Below
I know this is an extremely basic question but I'm very new to (non-HTML)
i'll have a try on my first question. This is a problem, I had
This is my first question here, but I hope I will get a lot
Hihi all, This could very well be a silly question. I would like to
First question ever on stackoverflow. Been reading for some time now, while trying to

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.