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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:58:46+00:00 2026-06-08T00:58:46+00:00

I have a list box which is bound to a Service. It loads fine

  • 0

I have a list box which is bound to a Service. It loads fine and allows me to select an item and moves through to second page.

The Second page loads a new observable collection from the same service and uses the selected Item from previous page to load a new listbox with a data filter.

This second listbox allows for a further selection to load a details page based on this selection. The error I have is that the second listbox loads and automatically selects the first item in the list. Upon pushing the back button it loads the second listbox with no selection made.

Can someone please tell me how to stop the automatic selection in my second listbox? Code details below.

First Listbox code including sender

void ServiceReference1Client_GetMensleaderListCompleted(object sender, GetMensLeaderListCompletedEventArgs e)
    {
        if (e.Error != null) { MensHeading.Text = "Connect to Data"; return; }

        ObservableCollection<Mens_Leaders> mensLeaders = e.Result;

        this.mensRankings.ItemsSource = mensLeaders;

    }

    private void mensRankings_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (mensRankings.SelectedItem != null)
        {
            Mens_Leaders SelectedPlayer = mensRankings.SelectedItem as Mens_Leaders;
            _SelectedMensPlayer = (sender as ListBox).SelectedItem;
            NavigationService.Navigate(new Uri("/Pages/PlayerProfile.xaml", UriKind.Relative));
            FrameworkElement root2 = Application.Current.RootVisual as FrameworkElement;
            root2.DataContext = _SelectedMensPlayer;
        }
    }

Page where second list loads

private void LoadPlayerList()
    {
        Service1Client ServiceReference1Client = new Service1Client();

        ServiceReference1Client.GetTournamentListCompleted += new EventHandler<GetTournamentListCompletedEventArgs>(ServiceReference1Client_GetTournamentListCompleted);
        ServiceReference1Client.GetTournamentListAsync();

        FrameworkElement root2 = Application.Current.RootVisual as FrameworkElement;
        var currentPlayer = root2.DataContext as ATP_Tennis_App.TennisService.Mens_Leaders;
        _SelectedPlayer = currentPlayer;
        _selectedPlayerTournamentsWon = currentPlayer.Name;

    }
void ServiceReference1Client_GetTournamentListCompleted(object sender, GetTournamentListCompletedEventArgs e)
    {
        if (e.Error != null) { return; }

        ObservableCollection<Tournaments> tournamentList = e.Result;

        viewSource = new CollectionViewSource();
        viewSource.Filter += TournamentWin_Filter;
        viewSource.Source = tournamentList;
        this.listBox1.ItemsSource = viewSource.View;
    }

    void TournamentWin_Filter(object sender, FilterEventArgs e)
    {
        if (e.Item != null)
            e.Accepted = ((Tournaments)e.Item).Prev_Male_Winner.Contains(_selectedPlayerTournamentsWon);
    }

    private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (listBox1.SelectedItem != null)
        {

            Tournaments selectedTournament1 = listBox1.SelectedItem as Tournaments;

            _SelectedItemTournament = (sender as ListBox).SelectedItem;
            NavigationService.Navigate(new Uri("/Pages/TournamentDetailsPanorama.xaml", UriKind.Relative));
            FrameworkElement root3 = Application.Current.RootVisual as FrameworkElement;
            root3.DataContext = _SelectedItemTournament;

        }
        else
        {
            return;
        }
    }
  • 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-08T00:58:48+00:00Added an answer on June 8, 2026 at 12:58 am

    On the listbox, set the IsSynchroziedWithCurrentItem to False. This fixed the issue.

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

Sidebar

Related Questions

I have got a list box in multi select mode which is data bound
I have a html form which have a select list box from which you
So, I have a ListBox which is bound to a list of business objects,
I have a list a simple dialog box which contains a few checkboxes, I
I have a list of links bound to a fairly narrow box; narrow enough
I have a ListBox which is bound to an instance of a list of
Hi have created a listbox which is bound to list of machines. As the
I have a checkbox list of sports which is bound to an observable collection
I have a list box which contains a usercontrol. And the user controls 2-3
I have a standard Listbox which is bound to a property in my viewmodel

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.