问题描述
我在gridview中添加了一个列的复选框我想在gridvew中选择要在报表查看器中显示的行吗?
我尝试过:
DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();
dataGridView1.Columns.Add(chk);
chk.HeaderText =For Report;
chk.Name =chk;
i add a column in gridview for checkbox i want choose rows in gridvew for showing in report viewer ?
What I have tried:
DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();
dataGridView1.Columns.Add(chk);
chk.HeaderText = "For Report";
chk.Name = "chk";
推荐答案
BindingList<CandidatesForJob> CandidatesDetails = new BindingList<CandidatesForJob>();
// Execute Linq query over collection of CandidatesDetails
var q = from w in CandidatesDetails select w;
dataGridView1.DataSource = q.ToList();
请参阅: []
以下是使用数据库的示例: []
这是一个 LINQ
教程: []
See: Linq to object with DataGridView[^]
Here is an example using a database: Querying the DataRowView Collection in a DataView[^]
Here is a LINQ
tutorial: LINQ Overview[^]
这篇关于选择gridvew中的行以在报表查看器中显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!