winform datatable 或datagridview中添加列

 DataGridViewCheckBoxColumn dg = new DataGridViewCheckBoxColumn();
dg.HeaderText = "选择";
dg.Width = ;
dataGridView1.Columns.Add(dg);

添加  table里直接添加  checkbox

 DataTable dt = new DataTable();
dt.Columns.Add("文件名");
foreach (string str in lstr)
{
DataRow dr = dt.NewRow();
dr[] = str; dt.Rows.Add(dr);
}
DataGridViewButtonColumn button = new DataGridViewButtonColumn();
button.HeaderText = "操作";
button.Text = "单独导出";
button.UseColumnTextForButtonValue = true;
dataGridView1.DataSource = dt;
dataGridView1.Columns.Add(button);
dataGridView1.Columns["文件名"].Width = ;

同理

上一篇:Classification Truth Table


下一篇:Linux Autotools