Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hoe to get selected Checkbox row value from DataGridView into collection using c# ?
Posted
Comments
Arasappan 29-Aug-15 1:31am    
Ur grid structure
Sathish km 29-Aug-15 2:05am    
hw can i show?
Sathish km 29-Aug-15 2:07am    
col1 col2 col3 checkboxColumn
1 a b X
2 c d X
3 e f X

1 solution

Hope Below code would help you

C#
foreach (DataGridViewRow getRowItems in GridName.Rows)
{
DataGridViewCheckBoxCell chkBox = (DataGridViewCheckBoxCell)(getRowItems.Cells["checkboxColumn"]);
     if (chkBox.Value == chkBox.TrueValue)
     {
        //Your Logic
     }
}
 
Share this answer
 
v2

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