2

I am facing a peculiar problem. I have an edmx file loaded with some entities. Some of them has navigation properties. I am using a Domain service class to fetch the data. The linq query is as follows:

var result = from res in ObjectContext.Accounts.Include("Branch")
                          where res.FYAccountID == fyAccountID
                          select res;
return result.ToList();

When I am adding 'watch' to 'result.ToList()', the data is being shown. That is, instead of BranchID, Branch Name is shown.

But, in the XAML, the data is not being shown. The column 'Branch Name' is showing no values. The XAML is as follows,

<dxg:AgDataGrid.Columns>
                <dxg:AgDataGridColumn FieldName="Branch.Name" AllowEditing="False"    ReadOnly="True" HeaderContent="Branch Name" GroupIndex="1">
                    <dxg:AgDataGridColumn.DisplayTemplate>
                        <ControlTemplate>
                            <TextBlock Text="{Binding DataContext.Branch.Name}" />
                        </ControlTemplate>
                    </dxg:AgDataGridColumn.DisplayTemplate>
                </dxg:AgDataGridColumn>
</dxg:AgDataGrid.Columns>

I have no idea why this is happening. Any suggestions?

4

0 回答 0