private void DeleteItem(object sender, EventArgs e) { var items = new List<Role>(); foreach (DataGridViewRow row in dataGridView.Rows) { if (row.Cells[0].Value != null && row.Cells[0].Value == "1") { items.Add(row.DataBoundItem as Role); } } if (items.Count > 0) { var biz = new RoleBiz(); biz.RemoveItem(items); RefreshItems(sender, e); } }
private void DeleteItem(object sender, EventArgs e) { var items = new List <Role>(); foreach (DataGridViewRow row in dataGridView.Rows) { if (row.Cells[0].Value != null && row.Cells[0].Value == "1") { items.Add(row.DataBoundItem as Role); } } if (items.Count > 0) { var biz = new RoleBiz(); biz.RemoveItem(items); RefreshItems(sender, e); } }