Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to use the DataGridViewCheckBoxColumn if checked =true, When you use th rows from DataGridView.
Posted
Updated 20-Nov-11 2:30am
v2
Comments
Sergey Alexandrovich Kryukov 20-Nov-11 17:18pm    
Do you mean th tag of HTML? Then tag the question accordingly. Is it ASP.NET? Tag it. Provide comprehensive explanation of what you want to achieve, provide fully qualified name of the type DataGridView.
--SA

check this out:

Adding a CheckBox column to your DataGrid[^]

hope it helps :)
 
Share this answer
 
Comments
RaviRanjanKr 20-Nov-11 9:05am    
My 5+
Uday P.Singh 21-Nov-11 1:40am    
thank you Ravi :)
Your Question is not very clear to me. If you want to get DataGridViewRows which are having checked value true for DataGridViewCheckBoxColumn then you may try as below code.
C#
foreach (DataGridViewRow dataGridRow in dataGridView1.Rows)
{
   if (dataGridRow.Cells["YourCheckboxColumn"].Value != null &&    (bool)dataGridRow.Cells["YourCheckboxColumn"].Value)
  {
         // Checked
  }
  else if (dataGridRow.Cells["YourCheckboxColumn"].Value == null)
  {
         // Unchecked
  }
}
 
Share this answer
 
v3
Comments
RaviRanjanKr 20-Nov-11 9:05am    
My 5+

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