I am Developing Windows Form Application in .Net, I want to insert selected rows value of Gridview into database. First Column of my GridView is Checkbox, when user check one or more checkbox from gridview, i want to insert values of respective rows into Database.
mohsinsayyad
0
Newbie Poster
Recommended Answers
Jump to PostI am Developing Windows Form Application in .Net, I want to insert selected rows value of Gridview into database. First Column of my GridView is Checkbox, when user check one or more checkbox from gridview, i want to insert values of respective rows into Database.
Try to use this
…
Jump to Postthat only i want to know,how to check which checkbox is checked.
Hi,
foreach (DataGridViewRow rw in dataGridView1.Rows) { if (rw.Cells[0].Value != null & Boolean.Parse(rw.Cells[0].Value.ToString())==true) { } }
Just remove that 0 and replace with the column index of that checkbox. This works.
All 6 Replies
murugavel84
0
Junior Poster in Training
mohsinsayyad
0
Newbie Poster
murugavel84
0
Junior Poster in Training
mohsinsayyad
0
Newbie Poster
bekoi
0
Newbie Poster
sourabhtripathi
-10
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.