DataGridViewButtonColumn btnCancel = new DataGridViewButtonColumn(); btnCancel.Name = "btnCanel"; btnCancel.HeaderText = "Cancel"; btnCancel.Text = "CANCEL"; btnCancel.FlatStyle = FlatStyle.Popup; btnCancel.DefaultCellStyle.ForeColor = Color.Red; btnCancel.DefaultCellStyle.BackColor = Color.Gainsboro; btnCancel.UseColumnTextForButtonValue = true; dataGridView1.Columns.Insert(0, btnCancel); private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0 && e.RowIndex >= 0) { ulong ordID = (ulong)dataGridView1.Rows[e.RowIndex].Cells[1].Value; myFunc(ordID); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)