Datagrid 在 Silverlight 中仅加载一个结果

发布于 2024-11-19 15:40:26 字数 1851 浏览 2 评论 0原文

我有一个 ria 域数据源,它为数据网格提供项目。然而,数据网格仅加载其中一个结果,并且至少返回 3 个结果。为什么会这样呢? 这是代码

            <sdk:DataGrid AutoGenerateColumns="False" IsEnabled="False" x:Name="prevSchoolDataGrid" ItemsSource="{Binding Path=Data, ElementName=gridDomainSource}" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Stretch" GridLinesVisibility="Horizontal" AlternatingRowBackground="#AD71BBFF" Margin="2,8" MinColumnWidth="100" >
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn x:Name="schoolColumn" Binding="{Binding SchoolName}" Header="School" CanUserSort="True"  />
                <sdk:DataGridTextColumn x:Name="awardColumn" Binding="{Binding Award}" Header="Award"  />
                <sdk:DataGridTextColumn x:Name="creditColumn" Binding="{Binding Credit}" Header="Credit" CanUserSort="True"  />
                <sdk:DataGridTextColumn x:Name="studyColumn" Binding="{Binding Study}" Header="Study"  />
                <sdk:DataGridTextColumn x:Name="dateAttendedColumn" Binding="{Binding DateAttended}" Header="Date Attended" IsReadOnly="True"  />
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>

和域数据源

        <riaControls:DomainDataSource PageSize="50" AutoLoad="True" x:Name="gridDomainSource" QueryName="GetPreviousSchoolsQuery" VerticalAlignment="Top">
        <riaControls:DomainDataSource.DomainContext>
            <my:ApplyDataContext />
        </riaControls:DomainDataSource.DomainContext>
        <riaControls:DomainDataSource.QueryParameters>
            <riaControls:Parameter ParameterName="email" Value="{Binding Text, ElementName=EmailTB}" />
        </riaControls:DomainDataSource.QueryParameters>
    </riaControls:DomainDataSource>

I have a ria domaindatasource that is providing the items for a datagrid. The datagrid however, is only loading one of the results and there are at least 3 results being returned. Why would this be?
Here is the Code

            <sdk:DataGrid AutoGenerateColumns="False" IsEnabled="False" x:Name="prevSchoolDataGrid" ItemsSource="{Binding Path=Data, ElementName=gridDomainSource}" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Stretch" GridLinesVisibility="Horizontal" AlternatingRowBackground="#AD71BBFF" Margin="2,8" MinColumnWidth="100" >
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn x:Name="schoolColumn" Binding="{Binding SchoolName}" Header="School" CanUserSort="True"  />
                <sdk:DataGridTextColumn x:Name="awardColumn" Binding="{Binding Award}" Header="Award"  />
                <sdk:DataGridTextColumn x:Name="creditColumn" Binding="{Binding Credit}" Header="Credit" CanUserSort="True"  />
                <sdk:DataGridTextColumn x:Name="studyColumn" Binding="{Binding Study}" Header="Study"  />
                <sdk:DataGridTextColumn x:Name="dateAttendedColumn" Binding="{Binding DateAttended}" Header="Date Attended" IsReadOnly="True"  />
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>

and the domain datasource

        <riaControls:DomainDataSource PageSize="50" AutoLoad="True" x:Name="gridDomainSource" QueryName="GetPreviousSchoolsQuery" VerticalAlignment="Top">
        <riaControls:DomainDataSource.DomainContext>
            <my:ApplyDataContext />
        </riaControls:DomainDataSource.DomainContext>
        <riaControls:DomainDataSource.QueryParameters>
            <riaControls:Parameter ParameterName="email" Value="{Binding Text, ElementName=EmailTB}" />
        </riaControls:DomainDataSource.QueryParameters>
    </riaControls:DomainDataSource>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尽揽少女心 2024-11-26 15:40:26

事实证明我在传入模型中设置了错误的数据键。所以客户端绑定错误。

Turns out I had set the wrong datakey in the incoming model. So the client was binding wrongly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文