Daniel's blog

.Net - Just cool!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
和以前的用法有点不同,所以记录下来了。

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
posted on 2005-10-01 08:59  Daniel  阅读(471)  评论(2编辑  收藏  举报