title: Datagrid binding asynchronous wpf
body: <p>everyone. I'm using WPF and trying to fill datagrid asynchronous, so it won't lock the UI.
  I'm loading the data from DB in asynchronous way, But if i have many record so the UI is locked until it finish fill the Datagrid. I tried almost everything and nothing is working.</p>
  
  <p>this is my xaml code:</p>
  
  <pre><code>&lt;DataGrid x:Name="dgOrgAtts" HorizontalAlignment="Left" Height="400" Margin="195,172,0,0" VerticalAlignment="Top" Width="419" RenderTransformOrigin="0.051,-0.272" CanUserReorderColumns="False" CanUserResizeRows="False" IsEnabled="False" AutoGenerateColumns="False" EnableColumnVirtualization="False" EnableRowVirtualization="False" CanUserSortColumns="False"&gt;
                  &lt;DataGrid.Columns&gt;
                      &lt;DataGridCheckBoxColumn Binding="{Binding Mode=OneWay}" CanUserResize="False" Width="30" &gt;
                          &lt;DataGridCheckBoxColumn.HeaderTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;CheckBox Checked="all_Checked" Unchecked="all_Unchecked" HorizontalAlignment="Center"/&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/DataGridCheckBoxColumn.HeaderTemplate&gt;
                          &lt;DataGridCheckBoxColumn.ElementStyle&gt;
                              &lt;Style TargetType="{x:Type CheckBox}"&gt;
                                  &lt;Setter Property="HorizontalAlignment" Value="Center"/&gt;
                              &lt;/Style&gt;
                          &lt;/DataGridCheckBoxColumn.ElementStyle&gt;
                          &lt;DataGridCheckBoxColumn.CellStyle&gt;
                              &lt;Style&gt;
                                  &lt;EventSetter Handler="OrgAtt_Checked" Event="ToggleButton.Checked"/&gt;
                                  &lt;EventSetter Handler="OrgAtt_Unchecked" Event="ToggleButton.Unchecked"/&gt;
                              &lt;/Style&gt;
                          &lt;/DataGridCheckBoxColumn.CellStyle&gt;
                      &lt;/DataGridCheckBoxColumn&gt;
  
                      &lt;DataGridTextColumn Binding="{Binding AttName, Mode=OneWay, IsAsync=True}" ClipboardContentBinding="{x:Null}" Header="סוג קבוצת שיוך" CanUserSort="False" CanUserReorder="False" Width="Auto"/&gt;
                      &lt;DataGridTextColumn Binding="{Binding AttText, Mode=OneWay, IsAsync=True}" ClipboardContentBinding="{x:Null}" Header="שם קבוצת שיוך" CanUserSort="False" CanUserReorder="False" Width="Auto"/&gt;
                      &lt;DataGridTextColumn Binding="{Binding OrgAttId, Mode=OneWay,  IsAsync=True}" ClipboardContentBinding="{x:Null}" Header="מספר" Width="*"/&gt;
                  &lt;/DataGrid.Columns&gt;
              &lt;/DataGrid&gt;
  </code></pre>
  
  <p>And this is how i'm bind the list to the datagrid:</p>
  
  <pre><code>Binding binding = new Binding();
                  binding.Source = orgAtt;
                  binding.IsAsync = true;
                  dgOrgAtts.SetBinding(DataGrid.ItemsSourceProperty, binding);
  </code></pre>
  
  <p>its working, but lock the UI.
  I would like to have your help.</p>