protected void btnDelAll_Click(object sender, EventArgs e) { try { StringBuilder sb = new StringBuilder(); foreach (int row in gvList.SelectedRowIndexArray) { sb.Append(gvList.DataKeys[row][0].ToString()); sb.Append(","); } int nflag = dictlabedpService.DelDictlabdeptByID(sb.ToString().TrimEnd(',')); if (nflag > 0) { MessageBoxShow("所选项已成功删除", MessageBoxIcon.Information); BindGrid(); gvList.SelectedRowIndexArray = new int[] { }; //dictlabdepId = 0; this.tbxLabdeptname.Text = string.Empty; } } catch (Exception ex) { MessageBoxShow(ex.Message, MessageBoxIcon.Error); } }