Home > Net >  C # dataGridView how to add a button for each row
C # dataGridView how to add a button for each row

Time:12-19

As title,

Each row in the first column shows the received value, the second column input to set value, after the third column is a button, click the second line of the input value sent to the next bit machine

As title,

CodePudding user response:

 
DataGridViewButtonColumn downLoad=new DataGridViewButtonColumn ();
The downLoad. The HeaderText="downLoad";
DownLoad the Name="downLoadColumn";
DownLoad. Text="downLoad";
DownLoad. Width=124;
DownLoad. UseColumnTextForButtonValue=https://bbs.csdn.net/topics/true;
DownLoad. DataPropertyName="_id";
DownLoad. Tag=downLoad. DataPropertyName;
DownLoad. DisplayIndex=3;

Dgv_mc. Columns. The Add (downLoad);
Dgv_mc. CellMouseClick +=new DataGridViewCellMouseEventHandler ((object sender, DataGridViewCellMouseEventArgs e)=& gt; {
If (e.c. with our fabrication: olumnIndex==3) {

}
});


The hope can help you

CodePudding user response:

I remember that the Button type column

CodePudding user response:

references on the 2nd floor buses meet response:
I remember that the Button type column
I remember seems to have direct DGV with Button controls
  •  Tags:  
  • C#
  • Related