title: DataGrid ScrollIntoView - how to scroll to the first row that is not shown?
body: <p>I am trying to scroll down a WPF DataGrid with code behind.
  I use</p>
  
  <pre><code>int itemNum=0;
  private void Down_Click(object sender, RoutedEventArgs e)
  {
      if (itemNum + 1 &gt; dataGridView.Items.Count - 1) return;
      itemNum += 1;
      dataGridView.UpdateLayout();
      dataGridView.ScrollIntoView(dataGridView.Items[itemNum]);
  }
  </code></pre>
  
  <p>This scrolls down only if the <code>itemNum</code> row is not currently shown.</p>
  
  <p>For example, If the DataGrid is long enough to hold 10 rows and I have 20 rows, I need to call this function 11 times (untill <code>itemNum</code> is 11) in order to scroll to the next row.</p>
  
  <p>It doesnt scroll down if the row is already fits in the grid (even if its the last on the screen).</p>
  
  <p>I want to achieve that when I call this method , the grid will bring the next line into the top of the grid (as the scroller does).
  Why isnt it working?</p>