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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:16:25+00:00 2026-05-23T10:16:25+00:00

I am using LINQ to Entites where I have two table objects ( ReferenceCodes

  • 0

I am using LINQ to Entites where I have two table objects (ReferenceCodes and Stock) with relationships.

I need to combine both as seperate columns in a ListView like this:

XAML

   <ListView Name="myListView">
        <ListView.View>
            <GridView>
                <GridViewColumn Header="Reference Code"/>
                <GridViewColumn Header="Description"/>
            </GridView>
        </ListView.View>
    </ListView>

Using a LINQ statement I am able to set the itemsource of each table separately like this:

Code Behind

Dim Context as New myEntity

myStock = From s In Context.Stocks.ToList
          Select s.Description

myListView.ItemSource = myStock

But how do I set each column as a separate item source for each table? I have tried a join statement like this:

Dim Context as New myEntity

myStock = From s In Context.Stocks.ToList
          Join r In Context.ReferenceCodes.ToList
          Select r.ReferenceDescription, s.Description

This seems to work except that it only displays a single column in this format:

{ ReferenceDescription = ABC1234 ; Description = My stock item description }

Instead of two separate columns, one a list of Reference Codes and the other a list of Stock Descriptions.

What am I doing wrong?

  • 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-05-23T10:16:25+00:00Added an answer on May 23, 2026 at 10:16 am

    You probably just need to set the DisplayMemberBindings of the columns when you have that joined collection of anonymous objects:

    <ListView Name="myListView">
         <ListView.View>
             <GridView>
                 <GridViewColumn Header="Reference Code"
                                 DisplayMemberBinding="{Binding ReferenceDescription}"/>
                 <GridViewColumn Header="Description"
                                 DisplayMemberBinding="{Binding Description}"/>
             </GridView>
         </ListView.View>
    </ListView>
    
    myListView.ItemsSource = myStock
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I am using the Linq entity framework. I have 2 entities: Content and
I'm using Linq to entities applying a Table per Type approach. This has been
Using LINQ to SQL, I have an Order class with a collection of OrderDetails.
I have two tables that are related via a mapping table: keywords titles I
I have been looking at using Linq to entities with WCF for some projects
I have an extension method to dynamically filter Linq to Entities results using string
Using LINQ to Entities with Entity Framework and C#: I have a method that
I have this project set up with EF4 and I'm using LINQ to Entities
I'm using a LINQ to Entities, and I have a couple of queries for
Using LINQ to Entities sounds like a great way to query against a database

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.