我设计了下面DataGrid
并用三列映射。我已经把这些记录拿走了Linq
并分配了这个Grid
。但是这个网格显示了几次记录。不知道是什么行为?如何解决这个问题?
<DataGrid Name="workgrid" ItemsSource="{Binding it}" Margin="12,152,0,148" HorizontalAlignment="Left" Width="517">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Width="100" Binding="{Binding PersonName}" />
<DataGridTextColumn Header="Place" Width="100" Binding="{Binding Place}" />
<DataGridTextColumn Header="Amount" Width="100" Binding="{Binding Amount}" />
</DataGrid.Columns>
</DataGrid>
var objResult = from c in objEntities.PersonAccounts
select new { c.PersonName, c.Amount, c.Place };
workgrid.ItemsSource = objResult;
Anu 的帮助或建议将不胜感激!!!