title: How to call Datagridview cell double click event from a button?
body: <p>I'm trying to call  datagridview cell event method from an another button. </p>
  
  <p><strong>DataGridView Cell Double Click Method</strong></p>
  
  <pre><code>private void ListDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
          {
              if (e.RowIndex &gt;= 0)
              {
                  ListDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
                  DataGridViewRow row = this.ListDataGridView.Rows[e.RowIndex];
  
                  comboBox2.Text = row.Cells[1].Value.ToString();
  
              }
          }
  </code></pre>
  
  <p><strong>This is Button where I'm calling this method</strong></p>
  
  <pre><code>private void button6_Click(object sender, EventArgs e)
  {
    ListDataGridView_CellDoubleClick(sender, e);
  }
  </code></pre>
  
  <p><strong>Error I'm receiving</strong></p>
  
  <blockquote>
    <p>Error 3   The type or namespace name 'DataGridViewCellEventHandler' does
    not exist in the namespace 'System' (are you missing an assembly
    reference?)   C:\VisualC#\Projects\DataGridViewApplication\DataGridViewApplication\List.Designer.cs   340 46  DataGridViewApplication</p>
  </blockquote>
  
  <p><strong>What I did:</strong></p>
  
  <p>I changed EventArgs to DataGridViewCellEventArgs.</p>
  
  <pre><code>private void button6_Click(object sender, DataGridViewCellEventArgs e)
     {    
       ListDataGridView_CellDoubleClick(sender, e);
     }
  </code></pre>
  
  <p>Now I'm receiving Error: </p>
  
  <pre><code>this.button6.Click += new System.EventHandler(this.button6_Click);
  </code></pre>
  
  <blockquote>
    <p>Error 3   No overload for 'button6_Click' matches delegate
    'System.EventHandler' </p>
    
    <p>C:\VisualC#\Projects\DataGridViewApplication\DataGridViewApplication\List.Designer.cs 340 35  DataGridViewApplication</p>
  </blockquote>
  
  <p><strong>Now I changed button event handler code to this</strong></p>
  
  <pre><code>this.button6.Click += new System.DataGridViewCellEventHandler(this.button6_Click);
  </code></pre>
  
  <p><strong>Still Receiving this error and stucked here</strong></p>
  
  <blockquote>
    <p>Error 3   No overload for 'button6_Click' matches delegate
    'System.EventHandler'</p>
  </blockquote>
  
  <p><strong>Found a solution here:</strong>
  <a href="https://stackoverflow.com/questions/27838861/how-to-call-a-datagridview-event-with-a-click-of-a-button">How to call a datagridview event with a click of a button?</a></p>
  
  <pre><code>private void button6_Click(object sender, EventArgs e)
          {
              ListDataGridView_CellDoubleClick(null, null);  
          }
  </code></pre>
  
  <p>but this is not working for me, it gives me an error.</p>
  
  <blockquote>
    <p>Object Reference not set to an instance of an object.</p>
  </blockquote>