ببخشید اشتباه از من بود
از خاصیت ItemsSource استفاده کن
<DataGrid x:Name="grid1" HorizontalAlignment="Right" AutoGenerateColumns="False" CanUserSortColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="False" CanUserResizeRows="False" SelectionUnit="FullRow" FlowDirection="RightToLeft" Margin="0,0,16,264" Width="1250" Height="283" VerticalAlignment="Bottom">
<DataGrid.Columns>
<DataGridTextColumn Header="شماره" Binding="{Binding ID}" Width="-20">
<DataGridTextColumn.HeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="FontFamily" Value="B Yekan"/>
<Setter Property="FontSize" Value="1"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.HeaderStyle>
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontFamily" Value="B Yekan"/>
<Setter Property="FontSize" Value="1"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns> </DataGrid>
var id=from d in db.VW_Item
where d.deleted!=0
select d;
var result = id.ToList(); grid1.ItemsSource = result;