如何添加两个按钮到一个DataGrid列动态?按钮、两个、动态、DataGrid

2023-09-03 08:04:14 作者:自古少年为情困﹑

按钮code

DataGridViewButtonColumn btn = new DataGridViewButtonColumn();  
dataGridView1.Columns.Add(btn);  

我使用的WinForms应用程序,在这里就这样我添加两个按钮,但我希​​望这两个按钮应该是发生在一列只。

I'm using WinForms App, here this way I add two buttons, but I want these two button should be place in single column only.

推荐答案

您必须创建一个自定义的列。看看和的此处一些例子。

You have to create a custom column. Look at here and here for some examples.