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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:21:09+00:00 2026-05-13T16:21:09+00:00

Given the data structure { Collection elements; String LocationName; } And a ComboBox that

  • 0

Given the data structure
{
Collection elements;
String LocationName;
}

And a ComboBox that is bound to a collection of such items (described in the structure) with DisplayMemberPath set to LocationName, how do I bind a datagrid to the SelectedItem.Elements of said combo box in XAML?

By my understanding the SelectedItem property of the combo box will return LocationName. I would need to move up in the data context of the structure then attach SourceItems to Elements. Correct? However I cannot seem to make it work with the Binding markup.

P.S. I am working on rigging a GUI with sample data.

Thank you.

Update 1: Code looks as follows:

<ComboBox x:Name="ComboBox1"
           ItemsSource="{Binding AdSources, Mode=OneWay}"
           DisplayMemberPath="NameProperty" />

<ComboBox x:Name="ComboBox2" 
               ItemsSource="{Binding SelectedItem.CollectionProperty, ElementName=ComboBox1, Mode=OneWay}"
               DisplayMemberPath="NameProperty2" />

<data:DataGrid x:Name="DataGrid"
        ItemsSource="{Binding SelectedItem.CollectionProperty, ElementName=ComboBox2, Mode=OneWay}">
      <data:DataGrid.Columns>
          <data:DataGridTextColumn Header="Column1" Binding="{Binding Property1}"/>
      </data:DataGrid.Columns>
</data:DataGrid>
  • 1 1 Answer
  • 1 View
  • 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-13T16:21:09+00:00Added an answer on May 13, 2026 at 4:21 pm

    The SelectedItem will point to the entire object, that’s why you specified a DisplayMemberPath for LocationName. The entire object is selected, but only the location name is displayed.

    You can bind to SelectedItem.Elements – if that doesn’t work, your problem is somewhere else.

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

Sidebar

Related Questions

Given the following XML structure: <root> <data>x</data> <details> <some_other_element>...</some_other_element> <collection> <element><a>1</a></element> <element><a>2</a></element> <element><a>3</a></element> <collection>
On JSON.org the essential data structures that JSON represents are given as A collection
I'm looking for a data structure to hold an unordered collection of unique elements,
I have an odd linq subquery issue. Given the following data structure: Parents Children
Given an arbitrarily nested data structure, how can I create a new data structure
I have a data structure which is as given below: class File { public
Given the following tree structure in Haskell: data Tree = Leaf Int | Node
I am trying to sample a data frame from a given data frame such
Another stupid question here regarding a SQL scenario. Given data such as: FieldKey DocumentKey
I'm looking for a data-structure, or combination of several, that can give me a

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.