Hi,
Try this if could help...
ArrayList checkedItems = new ArrayList();
CheckBox chk;
string chkBoxIndex = string.Empty;
foreach (GridViewRow row in GridContacts.Rows)
{
chkBoxIndex = (string)GridContacts.DataKeys[row.RowIndex].Value.ToString();
chk = (CheckBox)row.FindControl("CheckBox1");
if (!(Session["CheckedItems"] == null))
{
checkedItems = (ArrayList)Session["CheckedItems"];
}
if (chk.Checked)
{
if (!(checkedItems.Contains(chkBoxIndex)))
{
checkedItems.Add(chkBoxIndex);
}
else
{
checkedItems.Remove(chkBoxIndex);
}
}
}
if (checkedItems.Count > 0)
{
for (int i = 0; i < checkedItems.Count; i++)
{
}
}
/pre>
Regards,