Search This Blog

Wednesday, March 5, 2014

Handle click event in Button Column in DataGridView

C#DataGridViewDataGridViewButtonColumn

Add DataGridViewButtonColumn to your DataGridView.
To handle button click use CellClickEvent.

Example

private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
  if (e.ColumnIndex == dataGridView1.Columns["Browse"].Index && e.RowIndex >= 0)
  {
               
  }
}