int c =1; int sum =0; foreach (GridView row in GridView.Rows) { CheckBox cb = row.FindControl("chkStatus"); //Find checkbox control //Only the controls that are checked if (cb != null && cb.Checked) { sum = sum + row.Cells(c).Text; //Sum previous cell value plus every next selected drow cell value // Set the sum label text value } } txtSelected.Text = sum.ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)