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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:00:35+00:00 2026-06-17T14:00:35+00:00

I have the current code that defines my itemsource (what I want to display

  • 0

I have the current code that defines my itemsource (what I want to display to the user):

public class View
{
public string Name { get; set; }
public string Quantity { get; set; }
public List<Item> items { get; set; }
}

public class Item
{
public string ItemName { get; set; }
public double ItemQuantity { get; set; }
}

DataSet used:

List<View> myViews

So you end up with data like:

ViewA 50 {ItemA 50, ItemB 10, ItemC 20)
ViewB 10 {ItemC 10, ItemD 10, ItemE 10)

In my datagrid right now it shows the first two columns perfectly but the List shows as “Collection” (not the actual data), which I guess was to be expected.

This is my XAML right now

        <DataGrid Grid.Row="2" Margin="0,146,0,350"
              ItemsSource="{Binding myViews}"
              AutoGenerateColumns="False" Height="104">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Name" Width="*" FontSize="16"
                                Binding="{Binding Path=Name}" />
                <DataGridTextColumn Header="Quantity" Width="*" FontSize="16"
                                Binding="{Binding Path=Quantity}" />
                <DataGridTextColumn Header="Items" Width="*" FontSize="16"
                                Binding="{Binding Path=items}" />
            </DataGrid.Columns>
        </DataGrid>

I am trying to find a way to represent the List items to the user (either in this datagrid or some other way if this is not the right approach).

My idea was to actually have another Datagrid in the 3rd column with its own source of items, but I can’t seem to find out how I can make the 3rd column a Datagrid (as opposed to text like it is today). Does anyone know how this can be done (some examples would be awsome).

Or if this is really NOT the right way to solve this problem, any other ideas would also be much appreciated.

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-17T14:00:36+00:00Added an answer on June 17, 2026 at 2:00 pm

    You can use RowDetailsTemplate to present list of Item objects.

     <DataGrid Grid.Row="2"  Margin="0,146,0,350"
          ItemsSource="{Binding myViews}"
          AutoGenerateColumns="False" Height="104">
        <DataGrid.RowDetailsTemplate>
            <DataTemplate>
                <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding items}">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Item Name" Width="Auto" FontSize="16"
                                Binding="{Binding Path=ItemName}" />
                        <DataGridTextColumn Header="Item Quantity " Width="Auto" FontSize="16"
                                Binding="{Binding Path=ItemQuantity }" />
                    </DataGrid.Columns>
                </DataGrid>
            </DataTemplate>
        </DataGrid.RowDetailsTemplate>
    
        <DataGrid.Columns>
            <DataGridTextColumn Header="Name" Width="*" FontSize="16"
                            Binding="{Binding Path=Name}" />
            <DataGridTextColumn Header="Quantity" Width="*" FontSize="16"
                            Binding="{Binding Path=Quantity}" />                
        </DataGrid.Columns>
    </DataGrid>
    

    If you want present list of Item objects in third columns you should use DataGridTemplateColumn.

    <DataGrid Grid.Row="2" Margin="0,146,0,350"
          ItemsSource="{Binding myViews}"
          AutoGenerateColumns="False" Height="104">
        <DataGrid.Columns>
            <DataGridTextColumn Header="Name" Width="*" FontSize="16"
                            Binding="{Binding Path=Name}" />
            <DataGridTextColumn Header="Quantity" Width="*" FontSize="16"
                            Binding="{Binding Path=Quantity}" />
            <DataGridTemplateColumn Header="Items">
                <DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding items}">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="Item Name" Width="Auto" FontSize="16"
                                Binding="{Binding Path=ItemName}" />
                                <DataGridTextColumn Header="Item Quantity " Width="Auto" FontSize="16"
                                Binding="{Binding Path=ItemQuantity }" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </DataTemplate>
                </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>               
        </DataGrid.Columns>
    </DataGrid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that gets the current logged in user. userID = request.session.get(_auth_user_id)
I want to have a class that defines my parameter data for a stored
I have the following code that creates a submenu based on current document. The
I have a large chunk of code that manually defines each element of an
As a beginner in Ocaml, I have this current working code: ... let ch_in
The code i current have is this. function update (){ latest_id = $('#image:first').data('position'); /*
I have my current google maps code working to the point where if I
I am having a bit of difficulty with this current code I have set
I have following code return (EseshEntities.Current.Users.Select(u => new { Comunity = u.Apartment.Building.District.City })).ToList(); if
I have this following code which will return all the current semesters. How do

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.