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

  • Home
  • SEARCH
  • 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 6942811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:04:24+00:00 2026-05-27T13:04:24+00:00

I have a data grid where in i have to display an image and

  • 0

I have a data grid where in i have to display an image and again a datagris which has to display messages. I could bind the parent datagrid and image is getting displayed but the inner datagrid is not bound and neither displaying any error.

Am i missing anything? Here is my xaml

    <DataGrid Grid.Column="0" AutoGenerateColumns="False" Width="Auto" ItemsSource="{Binding Col1}" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Width="SizeToCells" Header="Column1" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate  >
                                <StackPanel Orientation="Vertical" >
                                    <Image   Source="{Binding ImagePathItem1}" Height="20" Width="20"/>
                                    <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}" Height="250" Width="250">
                                        <DataGrid.Columns>
                                            <DataGridTemplateColumn Width="SizeToCells" Header="Column2">
                                                <DataGridTemplateColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding MessageData}" Foreground="Orange"/>
                                                    </DataTemplate>
                                                </DataGridTemplateColumn.CellTemplate>
                                            </DataGridTemplateColumn>
                                        </DataGrid.Columns>
                                    </DataGrid>
                                </StackPanel>                                                                        
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>                       
                </DataGrid.Columns>
            </DataGrid>

The Col1 collection is bound to parent datasource and the data is available for all other controls.

  • 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-27T13:04:25+00:00Added an answer on May 27, 2026 at 1:04 pm

    I think you are misinterpreting what is the binding and in your example, the binding expression is incomplete: ItemsSource="{Binding}".

    As you said in your comment, Col1is an ObservableCollection<MyCollectionClass>. What would be interesting to see is the class itself, but anyway.

    When you bind Col1 to your parent DataGrid, the properties of the class are available to the child controls for binding (for each item in your collection). If there is again no such Col1 property in MyCollectionClass, you can’t bind it to the inner DataGrid !

    Imagine you have the following class (simplified):

    public class MyCollectionClass {
    
        public string Firstname { get; set; }
        public string Lastname { get; set; }
    
    }
    ObservableCollection<MyCollectionClass> Col1;
    

    You can then bind this way:

    ParentDataGrid: {Binding Col1)
         TextBox: {Binding Firstname}
         TextBox: {Binding Lastname}
         InnerDataGrid: {Binding Col1} // You can't do that
    

    For each instance of your class in your collection, you’ll have a row in your DataGrid with Firstname and Lastname because they are public properties of the class. But not with Col1.

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

Sidebar

Related Questions

We have a data grid to display member records for our clients. We recently
I have a DataGrid component that displays a few columns of data. It has
I have a data grid where I am displaying my messages. In that if
I have data grid view with columns product name and product image and I
I have a datagrid which has several static and more dynamicaly generated coloumns. The
I have a JavaScript based page where a grid displays all the data for
I have a Silverlight DataGrid that contains a single template column which displays a
I have a Data grid with DatagridComboBoxColumn , and i want to Fire Event
I am a beginner to WPF . I have a data grid for showing
When saving a new entity something strange happens... I have a data grid with

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.