Datagrid 在 Silverlight 中仅加载一个结果
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明我在传入模型中设置了错误的数据键。所以客户端绑定错误。
Turns out I had set the wrong datakey in the incoming model. So the client was binding wrongly.