Tuesday, November 06, 2012

Gridview with checkbox

This code snippet will be used to find out the checked box's row  in ASP.NET GridView.



  for(int i = 0;i < grid.Rows.Count;i++)
            {
            CheckBox cb = (CheckBox)grd.Rows[i].FindControl("chkName");
if (cb.Checked)
{


                    b.Append(grid.Rows[i].Cells[1].Text.ToString()+",");
}
}
            Response.Write(b.ToString());