Click here to Skip to main content
15,921,279 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i fetched data and bounded to gridview and checkbox is added here in other page where i retrieved the data and added to gridview here we have to check checkboxes multiple one or two may be three the state of these checkboxes must get updated in database using single click.
i tried but iam not finding the correct way to do it

What I have tried:

 foreach (GridViewRow gridViewRow in GridView2.Rows)
            {
                
            CheckBox  chkSelect = (CheckBox)gridViewRow.FindControl("C");
                id=Convert.ToInt32(GridView2.DataKeys[gridViewRow.RowIndex].Values[0]);

                if (chkSelect.Checked)
                {
}
Posted
Updated 5-Jul-17 0:48am

1 solution

Why arent you reading the Microsoft documentation on checkboxes? The property Checked is also a setter and the tri-state has a enum.

Some more tutorial on checkboxes. Pay attentention to the handler functions.
 
Share this answer
 
Comments
saimanisha 5-Jul-17 7:12am    
MY QUESTION IS NOT ABOUT CHECK OR NOT I WANT TO GET CHECKED CHECKBOX VALUE FROM GRIDVIEW OF THAT ROW AND I WANT TO UPDATE IT TO DATABASE

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