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 8507583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:54:48+00:00 2026-06-11T02:54:48+00:00

I’m new to Windows Phone 7 development. In my First Application I want to

  • 0

I’m new to Windows Phone 7 development.

In my First Application I want to Create two listboxes with checkboxes inside them in different pages and to fill the first listbox with some Data. When I select some records in first listbox, that particular records have to be added in another listbox. I done listbox selection and also pass the selecteditem via parameter to another page, when I tried to assign that list to listbox.ItemSource it throws ArgumentNullException.

Please help me to solve this problem.

Thanks.

  • 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-11T02:54:49+00:00Added an answer on June 11, 2026 at 2:54 am

    Firstly, as you are pointing out, ArgumentNullException is being thrown. So basically when you are doing the assignment to ItemsSource you are providing a null. In other terms, the object you think you have received from the object page is null.

    Secondly, it is hard to help you debug the problem if you are not providing any source code. But, generally speaking are you able to test with dummy data and from code-behind (i.e. not from the XAML) when you are in the 2nd page that the listbox there gets populated? So, for the time being ignore the passing of data. Just ensure that when the 2nd page is loaded, the listbox is populated with dummy data that you have created in the code-behind of that page. If that works then your problem is simpler.

    Hopefully, this helps.

    //– Adding sample Code — //

    Firstpage.xaml

    <ListBox x:Name="FirstListBox" Grid.Row="1" ItemsSource="{Binding}" SelectionChanged="HandleSelection">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding}" FontSize="32" Margin="12"/>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
    

    Firstpage.xaml.cs

    FirstListBox.DataContext = new String[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" };
    

    …

    private void HandleSelection(object sender, SelectionChangedEventArgs e)
    {
        String selection = (String)FirstListBox.SelectedItem;
        NavigationService.Navigate(new Uri("/Secondpage.xaml?id=" + selection, UriKind.Relative));
    }
    

    Secondpage.xaml

    <ListBox x:Name="OtherListBox" Grid.Row="1" ItemsSource="{Binding}">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding}" FontSize="32" Margin="12"/>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
    

    Secondpage.xaml.cs

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        String id = null;
        NavigationContext.QueryString.TryGetValue("id", out id);
        if (id != null)
        {
            List<String> dummyData = new List<string>();
            for (int i = 0; i < 12; i++)
            {
                dummyData.Add(id + " - " + i);
            }
            OtherListBox.DataContext = dummyData;
        }
    }
    

    So, as you can read from the i have a dummy list in Firstpage and when i click on any of the items it takes me to another page where there is another list which have been populated with data generated from my initial selection. As you see i am passing the selection as a querystring parameter just like i explained in my comments of this answer.

    Hopefully this solves your problem and i look forward to you accepting this solution as an answer to your problem.

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I've tracked down a weird MySQL problem to the two different ways I was
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I want to show the soap response to UIWebview.. my soap response is, <p><img

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.