title: How to synchronise horizontal scrolling in DataGridViews
body: <p>I have three DataGridViews: dgvSTART; dgvFilter; dgvEdit.</p>
  
  <p>I have edited the scroll event for dgvSTART, inline with the answer <a href="https://stackoverflow.com/questions/5220343/c-sharp-windows-form-2-gridviews-with-synced-scroll">here</a>, which looks like:</p>
  
  <pre><code>dgvEdit.FirstDisplayedScrollingColumnIndex = dgvSTART.FirstDisplayedScrollingColumnIndex;
  dgvFilter.FirstDisplayedScrollingColumnIndex = dgvSTART.FirstDisplayedScrollingColumnIndex;
  </code></pre>
  
  <p>This works, but only scrolls the other two DataGridViews when the left hand column of dgvSTART changes (ie the column dissapears/appears off the side of the panel).</p>
  
  <p>Is it possible to make all the datagridviews scroll as one (ignoring the column boundaries)?</p>
  
  <p>I think this is possible using the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.horizontalscrollingoffset.aspx" rel="nofollow noreferrer">HorizontalScrollingOffset</a> property of the DataGridView, but my attempt was unsuccessful:</p>
  
  <pre><code>private void dgvSTART_Scroll(object sender, ScrollEventArgs e)
      {
          //using matching the first column shown
          dgvEdit.FirstDisplayedScrollingColumnIndex = dgvSTART.FirstDisplayedScrollingColumnIndex;
          dgvFilter.FirstDisplayedScrollingColumnIndex = dgvSTART.FirstDisplayedScrollingColumnIndex;
  
          try
          {
              //trying to use horizontalscrollingoffset
              if (e.NewValue &lt; e.OldValue)
              {
                  dgvEdit.HorizontalScrollingOffset = dgvFilter.HorizontalScrollingOffset - 10;
                  dgvFilter.HorizontalScrollingOffset = dgvFilter.HorizontalScrollingOffset - 10;
              }
              else
              {
                  dgvEdit.HorizontalScrollingOffset = dgvEdit.HorizontalScrollingOffset + 10;
                  dgvFilter.HorizontalScrollingOffset = dgvFilter.HorizontalScrollingOffset + 10;
              }
          }
          catch (Exception) { }//do nothing with the exception        
      }
  </code></pre>