Click here to Skip to main content
11,930,217 members (38,623 online)
Rate this:
Please Sign up or sign in to vote.
Hi fellows. I have a DataGridView control with a CheckBoxColumn in it, and a CheckBox on the Header. There are some articles regarding this topic , but, i want the DataGridView to behave like i said in the Subject, like yahoo or gmail when you select the checkbox of an email and the corresponding row gets selected too.Does anyone have some clues regarding this?

Thanks in advance!!!
Posted 24-Jan-13 10:26am
Sergey Alexandrovich Kryukov 24-Jan-13 16:13pm
What did you try? It looks trivial, as the selecting/selected events are available.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

U can use below on form load event
DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();
chk.HeaderText = "Check Data";
chk.Name = "chk";
then on to change coor on checkbox click put code on cellmouseclick.
if (dataGridView1.Rows[e.RowIndex].Cells["chk"].Value == true)
       for(int i=0;i < dataGridView1.Rows[e.RowIndex].Cells.Count; i++)
            dataGridView1.Rows[e.RowIndex].Cells[i].Style.BackColor = Color.Green;
hope it helps u out.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100