Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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";
Posted
Updated 20-May-16 21:35pm
Comments
Karthik_Mahalingam 20-May-16 23:55pm    
Please Tag it properly
Gridview is an ASP control.
DataGridView is a windows control.

1 solution

You could use LINQ to query the data, here is an example (without using a database):
C#
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();

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[^]
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900