Hi,
How can we add button to dataGridView control in windows form application?
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Datta KharadPosted Jan 19, 2012, 12:43 AM
Add Button to datagridview Control:-
var buttonCol = new DataGridViewButtonColumn();
buttonCol.Name = "ButtonColumnName";
buttonCol.HeaderText = "Header";
buttonCol.Text = "Button Text";
dataGridView.Columns.Add(buttonCol);
foreach (DataGridViewRow row in dataGridView.Rows)
{
DataGridViewButtonCell button = (row.Cells["ButtonColumnName"] as DataGridViewButtonCell);
}
Krishna GaradPosted Jan 19, 2012, 12:27 AM