2
I am developing a Windows Form C# activity control application for a company, however I would need to display activities such as buttons within the cell of GridView
.
I’ve tried to:
DataGridViewButtonColumn uninstallButtonColumn = new DataGridViewButtonColumn();
uninstallButtonColumn.UseColumnTextForButtonValue = true;
uninstallButtonColumn.HeaderText = "Delete/Edit";
uninstallButtonColumn.Name = "uninstall_column";
uninstallButtonColumn.Text = "Teste";
dgvPrincipal.Columns.Insert(1, uninstallButtonColumn);
This format allows only 1 button, when in fact there can be several buttons on the same cell.
And I’ve tried too:
dgvPrincipal.Rows[0].Cells[0].DataGridView.Controls.Add(tbnTeste);
This inserts the button without any link with the cells..
Does anyone know a way? Like DataRowBound
... or something like that?
Why don’t you put the buttons in another column?
– PauloHDSousa
At this link has an example that can give you a direction to follow.
– mateusalxd