Pasing the selected checkbox integer values in gridview in a single list
<p>I ve a gridview with checkbox, wherein if I select the checkboxes, the respective values are got using datakeys.How do I pass the values in a list as a whole instead of loopin with foreach? I need to pass it in asingle variable. Any help is appreciated</p>

<pre><code>                 foreach (GridViewRow row in gvAll.Rows)
               {

                 string status =row.Cells[4].Text;
                              CheckBox chkb = (CheckBox)row.FindControl("chk");
             //Rows[i].Cells[0].FindControl("CheckBox1");
             if (chkb.Checked)
             {
                 int id = Convert.ToInt32(gvAll.DataKeys[row.RowIndex].Values[0]);
                 //int id  =int.Parse(a);



                 if (!(id.Equals(System.DBNull.Value)))
                 {
                     if (String.Equals(a, status))
                     {
                         SC.Mark(id);

                     }
                     if (String.Equals(b, status))
                     {
                         SC.Mark_next(id);
                                                 }
                 }
             }
</code></pre>
