Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 手动将按钮添加到gridview行_C#_Winforms_Datagridview - Fatal编程技术网

C# 手动将按钮添加到gridview行

C# 手动将按钮添加到gridview行,c#,winforms,datagridview,C#,Winforms,Datagridview,我只想有一个动态网格视图,每行包含3个按钮。我只想在这个网格视图中有5行。我使用这段代码将数据填充到一行中,但我不知道如何将按钮添加到每行中?有人能帮我吗 DataGridViewRow row = new DataGridViewRow(); row.CreateCells(scanImagesGrid); row.Cells[0].Value = "1"; row.Cells[1].Value = "عکس شخصی"; row.Cells[2].Value= //my button no1

我只想有一个动态网格视图,每行包含3个按钮。我只想在这个网格视图中有5行。我使用这段代码将数据填充到一行中,但我不知道如何将按钮添加到每行中?有人能帮我吗

DataGridViewRow row = new DataGridViewRow();
row.CreateCells(scanImagesGrid);
row.Cells[0].Value = "1";
row.Cells[1].Value = "عکس شخصی";
row.Cells[2].Value= //my button no1
row.Cells[3].Value= //my button no2
row.Cells[4].Value= //my button no4
scanImagesGrid.Rows.Add(row);
我还想知道如何响应每行中每个按钮的点击事件。 非常感谢

请参考确切的问题。请阅读本文