GridView

StringBuilder sbLogID = new StringBuilder();
foreach (GridViewRow row in gvLog.Rows)
{
      CheckBox chk = row.FindControl("chkItem") as CheckBox;

       if (chk != null && chk.Checked)
       {
             sbLogID.AppendFormat("{0}|", gvLog.DataKeys[row.RowIndex].Value);
       }
}

if (sbLogID.Length > 1)
{
      sbLogID.Remove(sbLogID.Length - 1, 1);
}

posted @ 2010-08-01 15:29  libingql  阅读(208)  评论(0编辑  收藏  举报