foreach (DataGridItem i in MyDataGrid.Items)
{
checkBox = (CheckBox) i.FindControl ("SelectCheckBox");//SelectCheckBox为控件的ID
{
checkBox = (CheckBox) i.FindControl ("SelectCheckBox");//SelectCheckBox为控件的ID
if (checkBox.Checked)
{
type = MyDataGrid.Items[index].Cells[1].Text;//DataGrid中某行某列的值Items-行 Cells-列
dropDownList = (DropDownList) i.FindControl ("subtype");
subType = dropDownList.SelectedItem.Value.ToString();//提取下拉框选中值的索引Text是取得选中的值
}
index += 1 ;
}