Add Buttons dynamically in the datagridview windows forms

Posted by Rajesh081725 under C# category on | Points: 40 | Views : 5143
Add Column With Button In DataGridView Dynamically
Follow this Code

DataGridViewButtonColumn bcol = new DataGridViewButtonColumn();
bcol.HeaderText = "Button Column ";
bcol.Text = "Click Me";
bcol.Name = "btnClickMe";
bcol.UseColumnTextForButtonValue = true;

And For Handling Click Event of Button

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
if (e.ColumnIndex == 1)

//StateMents you Want to execute to Get Data

Comments or Responses

Login to post response