Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got a datagrig view with 4 columns
eg,Name,Add,Dob and 4th column with checkbox
now when i load multiple values it it i want to save only selected rows value i.e row ehere i click on checkbox.
Posted

Please see below link for similar issue

get value from selected rows in datagridview[^]
 
Share this answer
 
If the checkbox column is bound you can get its value (and of the other columns) and save it. If its in a templatecolumn you should find the checkbox control first and then get its value.
 
Share this answer
 
you can use CellContentClick event in datagridview

C#
private void grdFclick_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
   if(bool.Parse(grdFclick.Rows[e.RowIndex].Cells[0].EditedFormattedValue.ToString()))
     {

        string val = grdFclick.Rows[e.RowIndex].Cells[1].Value.ToString();
     }
}
 
Share this answer
 

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