Looping through GridView rows and Checking Checkbox Control

后端 未结 2 1421
南方客
南方客 2020-12-04 01:21

I currently have a GridView which displays data from a Student Table, here is my Grid and associated SQLDataSource;

                      

        
2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-04 02:07

    Loop like

    foreach (GridViewRow row in grid.Rows)
    {
       if (((CheckBox)row.FindControl("chkboxid")).Checked)
       {
        //read the label            
       }            
    }
    

提交回复
热议问题