Pickick a GridView, Connect it to a table.
- Go to the 'Edit-Columns' of the GridView.
- Add a 'template-field'
- Hit OK.
- Now, go to the 'Edit-Template' of the GridView.
- In the 'Column[0]' of the Item-Template, drag-drop a CheckBox
- Check out whats the ID of the CheckBox (must be CheckBox1)
-- That's it.
Now Stop 'Editing Template'
In the Code-Behind use the following code :
foreach (GridViewRow gr in GridView1.Rows)
{
CheckBox cb = (CheckBox)gr.Cells[0].FindControl("CheckBox1");
if (cb.Checked)
{
// do ur job here
}
}
thus u can access ur checkbox by iterating thru the GridView Rows.
hope this explained alot for u