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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:23:34+00:00 2026-06-16T18:23:34+00:00

I have two lists with different ItemsSource but with SelectedItem bound to the same

  • 0

I have two lists with different ItemsSource but with SelectedItem bound to the same property – “Name“.

First i’m choosing the item “c” in the right list so the item “c” in the left list is selected as well.

Than I selected another item in the right list but the “c” in the left list is still selected.
I understand why it do that, but can I make it unselect the “c” in the right list ?

enter image description here

XAML:

 <Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition  />
        <ColumnDefinition  />
    </Grid.ColumnDefinitions>

    <ListView SelectedItem="{Binding Name}" ItemsSource="{Binding lstNames1}"/>
    <ListView SelectedItem="{Binding Name}" ItemsSource="{Binding lstNames2}" Grid.Column="1"/>
</Grid>

Code behind:

 public partial class selected : Window
{
    public ObservableCollection<string> lstNames1 { get; set; }
    public ObservableCollection<string> lstNames2 { get; set; }

    public string Name { get; set; }


    public selected()
    {
        Names1 = new ObservableCollection<string> {"a1", "b1", "c"};
        Names2 = new ObservableCollection<string> { "a2", "b2", "c" };
        InitializeComponent();
        DataContext = this;
    }
}
  • 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-16T18:23:35+00:00Added an answer on June 16, 2026 at 6:23 pm

    If you switch the SelectedItem binding to SelectedValue this will behave how you want, The SelectedItem is not clearing because its not set to null because the other list has set a value, SelectedValue acts a bit differntly as it has to find an item or it will clear the SelectedItem on the list.

    <ListView SelectedValue="{Binding Name}" ItemsSource="{Binding lstNames1}" />
    <ListView SelectedValue="{Binding Name}" ItemsSource="{Binding lstNames2}" Grid.Column="1"/>
    

    Hope that make sense 🙂

    enter image description here
    enter image description here

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

Sidebar

Related Questions

I have two lists with same items and different orders. for example: a =
Here’s my problem, I have two different lists, list a which contains the name
I have two nested lists of different sizes: A = [[1, 7, 3, 5],
I have two strings in two different lists A = [dog bit dog null]
Working in Python 2.7. I have two different lists, A and B (simplified to
i have two different Lists. List<MyClass> list1 = new List<MyClass>(); List<OtherClass> list2 = new
I have two lists where the order of one list is different from the
I have two lists with different objects in them. List<Object1> list1; List<Object2> list2; I
I have two different lists where one is a bunch of ID's as in
I have two Generic Lists containing different types, for the sake of example, lets

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.