I have a pretty large object and some of it's properties should be shown in a datagrid. The problem is that the binding is not doing well and the nested object values are empty.
The MainCustomObject is:
public class MainCustomObject
{
public int Id { get; set; }
public string Name { get; set; }
public CustomObject1 CustomObject1 { get; set; }
}
The CustomObject1 is:
public class CustomObject1
{
public string Name { get; set; }
public string Url { get; set; }
}
And my XAML code is:
<DataGrid ItemsSource="{Binding MainCustomObjectList}" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Width="75" Binding="{Binding Name}" />
<DataGridTextColumn Header="CustomObject1_Name" Width="75" Binding="{Binding CustomObject1.Name}" />
<DataGridTextColumn Header="CustomObject1_Url" Width="75" Binding="{Binding CustomObject1.Url}" />
</DataGrid.Columns>
</DataGrid>
Thanks for the help guys.
is not doing wellwhat? I mean: what's wrong with it?CustomObject1look like? Does it have public Id and Name properties?