using checkbox in gridview
-
hiiii, I have a gridview with fileds Id,Name,Email,Citizenship and Flag bounded to the gridview from the database. And my gridview also having checkbox. And one button submit. when the checkbox is checked and the button is clicked i like to update the flag column which is null to "selected". plz tell me how i can do this... Thanx in advance
-
hiiii, I have a gridview with fileds Id,Name,Email,Citizenship and Flag bounded to the gridview from the database. And my gridview also having checkbox. And one button submit. when the checkbox is checked and the button is clicked i like to update the flag column which is null to "selected". plz tell me how i can do this... Thanx in advance
for (int i = 0; i < Grid.Rows.Count; i++) { GridViewRow rows = Grid.Rows[i]; bool ischeck = ((Checkbox)rows.FindControl("Checkbox1")).Checked; if (ischeck) { //your update query here } }
Padmanabhan
modified on Wednesday, May 27, 2009 9:24 AM