I want to add 3 buttons in a single column of a DataGridView and I do not know how to do it correctly, I can dynamically generate the column that I want
Code To generate a blank column.
DataGridViewColumn acciones = new DataGridViewColumn();
acciones.CellTemplate = dataTabla.Columns[0].CellTemplate;
acciones.AutoSizeMode = dataTabla.Columns[0].AutoSizeMode;
acciones.HeaderText = "Acciones";
acciones.Name = "ColAcciones";
dataTabla.Columns.Add(acciones);
Code to generate the button inside the column. (It does not work)
Button btnEliminar = new Button();
btnEliminar.Text = "Eliminar";
foreach (DataGridViewRow row in dataTabla.Rows)
{
row.Cells["ColAcciones"].Value = btnEliminar;
}
the column continues to be created with nothing inside it.
I already tried to do it with ColumnButton, but I do not want a single button per column, I want three in the same column.