Hi,
This is the general solution, but I don't know what you want to achieve, so modify this according to your needs
private ArrayList GetCheckedItems(string ctrl, DataGrid grid)
{
ArrayList checkedItems = new ArrayList();
CheckBox chk;
string strID = string.Empty;
foreach(DataGridItem item in grid.Items)
{
chk = (CheckBox)item.Cells[0].Controls[1];
strID = grid.DataKeys[item.ItemIndex].ToString();
if (chk.Checked)
{
if (!(checkedItems.Contains(strID)))
{
checkedItems.Add(strID);
}
}
}
return checkedItems;
}
BTW. Try to google for this, you have many examples on net about this topic.