none
Child data is not loading RRS feed

  • Question

  • StudyTemplates =   _dataContext.StudyDocumentTemplates.Where(s
    => s.StudyId == StudyId) .ToList<StudyDocumentTemplate>();


    <DataGrid Margin="10"  Grid.Row="2" AutoGenerateColumns="False"
                                  HorizontalAlignment="Left"  VerticalAlignment="Top"
                              ScrollViewer.CanContentScroll="True"
                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
    CanUserAddRows="False"   ItemsSource="{Binding StudyTemplates}" Width="500" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="TemplateName"  Binding="{Binding Path=TemplateName}" Width="150"/>
                        <DataGridTextColumn Header="DocumentType"  Binding="{Binding Path=DocumentType.Name}" Width="150"/>
                        <DataGridTextColumn Header="File Name"  Binding="{Binding Path=FileName}" Width="150"/>
                    </DataGrid.Columns>
                </DataGrid>
    Why is Document type is not loading when the grid is
    populated and the database got values for the file when I run the script in SQL
    is working fine

    SQL
    select a.*,b.Name
    from
    StudyDocumentTemplate a
    inner join
    documenttype b on a.documenttypeid=b.documentTypeID

    all the help would be appriciated

     

    Monday, March 19, 2012 4:27 PM

Answers

  • Hi Rushdy Najath,

    Welcome to MSDN Forum.

    Please add a break point after the line of your Linq query, and to check whether the result is returned or not. If the result is returned, it may caused by DataGrid databinding, you can ask the question in ASP.NET Forum, there are more specialists of ASP.NET there, I think you can get more help. If the result isn't returned, you can execute the T-SQL which the Linq query auto-generated in the database, and find whether the T-SQL is correct.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, March 21, 2012 5:28 AM
    Moderator