title: DataGridView: Scroll bar does not get refreshed
body: <p>I am working (fixing bugs) on a project which was written in VS 2005. There is one DataGridView control on a form. When it is first time loaded, the control's data grid is populated with rows of data from a collection manually or in codes. Actually, there is method PopulateDataGrid() do the job.</p>
  
  <p>There is also another control on the form. When control is changed, the data grid will be cleared first and then rows are repopulated again through PopulateDataGrid(). The problem is that when the grid is refreshed, the vertical scroll bar does not get reset correctly. I thought it should be. Since the scroll bar is not reset, when I tried to click on grid and move down, I got exception: {"Value of '222' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.\r\nParameter name: Value"}:</p>
  
  <pre><code> at System.Windows.Forms.ScrollBar.set_Value(Int32 value)
   at System.Windows.Forms.DataGridView.ScrollRows(Int32 rowCount, Int32 deltaY, ScrollEventType scrollEventType)
   at System.Windows.Forms.DataGridView.ScrollRowsByCount(Int32 rows, ScrollEventType scrollEventType)
   at System.Windows.Forms.DataGridView.ScrollRowIntoView(Int32 columnIndex, Int32 rowIndex, Boolean committed, Boolean forCurrentCellChange)
   at System.Windows.Forms.DataGridView.ScrollIntoView(Int32 columnIndex, Int32 rowIndex, Boolean forCurrentCellChange)
   at System.Windows.Forms.DataGridView.ProcessDownKeyInternal(Keys keyData, Boolean&amp; moved)
   at System.Windows.Forms.DataGridView.ProcessDataGridViewKey(KeyEventArgs e)
   at System.Windows.Forms.DataGridView.OnKeyDown(KeyEventArgs e)
   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message&amp; m)
   ...
  </code></pre>
  
  <p>All the settings for grid control are default values. For example, the ScrollBars is Both. The following is the only related place to set row auto size property:</p>
  
  <pre><code>poDataGridView.AutoSizeRowsMode =
              DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders;
  </code></pre>
  
  <p>I am not sure if there is any property I have to set in designer?</p>