和以前的用法有点不同,所以记录下来了。
ArrayList list = new ArrayList();
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox box = (CheckBox)row.Cells[3].Controls[1];
if (box.Checked)
list.Add(row.Cells[0].Text);
}
return list;
Dim list As ArrayList = New ArrayList()
For Each row As GridViewRow In GridView1.Rows
Dim box As CheckBox = CType(row.Cells(3).Controls(1), CheckBox)
If (box.Checked) Then
list.Add(row.Cells(0).Text)
End If
Next
Return list
ArrayList list = new ArrayList();
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox box = (CheckBox)row.Cells[3].Controls[1];
if (box.Checked)
list.Add(row.Cells[0].Text);
}
return list;
Dim list As ArrayList = New ArrayList()
For Each row As GridViewRow In GridView1.Rows
Dim box As CheckBox = CType(row.Cells(3).Controls(1), CheckBox)
If (box.Checked) Then
list.Add(row.Cells(0).Text)
End If
Next
Return list