Use same as below code
foreach (RepeaterItem rept in rptbom.Items)
{
CheckBox chkSelect = (CheckBox)rept.FindControl("chkSelect");
Int64 fg_id = Convert.ToInt64(((HiddenField)rept.FindControl("hdnfg_id")).Value);
if (chkSelect.Checked == true)
{
}
}
It is for repeater same is for gridview
foreach (GridviewRow grd in grdDetail.Rows)
{
CheckBox chkSelect = (CheckBox)grd.FindControl("chkSelect");
Now Change your code same as above.
if you have any problem then you can contact with me.